import java.util.*; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] a = new int[n]; for(int i=0; i t[k+1]) { int c = t[k]; t[k] = t[k+1]; t[k+1] = c; cnt++; } } } System.out.println(cnt); } } }