Determine how many exchange operations are done in bubble sort algorithm to sort the elements of array in ascending order.
The first line contains the number of elements n (1 ≤ n ≤ 1000) in array. The second line contains the array itself. It is guaranteed that all array elements are different and do not exceed 10^9
by absolute value.
Print the number of swaps in bubble sort.