Determine how many swaps the bubble sort algorithm performs to sort the given array in ascending order.
The first line contains the number of elements (1 \le n \le 1000) in the array.
The second line contains the array itself.
It is guaranteed that all array elements are distinct and that their absolute values do not exceed 10^9.
Print one integer — the number of swaps performed by bubble sort.
Example 1
Example 2
Example 3