Determine the number of swaps performed by the bubble sort algorithm to sort a given array in ascending order.
The first line contains an integer (1 \leq N \leq 1000), the number of elements in the array. The second line contains integers, the elements of the array. It is guaranteed that all elements are distinct, and their absolute values do not exceed 10^9.
Output a single integer: the total number of swaps performed by the bubble sort algorithm.
Example 1