import java.util.*; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); String line; while (scan.hasNextLine()) { line = scan.nextLine().trim(); // please write your code here String str[] = line.split(","); int arr[] = new int[str.length]; for(int i=0;i<arr.length;i++) arr[i] = Integer.parseInt(str[i]); int sum=0; for(int i=0;i<arr.length-1;i++) for(int j=i+1;j<arr.length;j++) if(arr[i]>arr[j]) sum++; System.out.println(sum); } } }