Determine the number of swaps that will occur during a bubble sort for sorting a given array in ascending order.
The first line contains the integer (1 ≤ n ≤ 1000), which represents the number of elements in the array. The second line contains the array itself. It is guaranteed that all elements of the array are distinct and do not exceed 10^9 in absolute value.
Output a single integer representing the number of swaps that occur during the bubble sort.
Example 1
Example 2
Example 3