Determine how many exchanges the ascending bubble sort algorithm will do for the given array.

Input

The first line is a number N (\(1 <= N <= 1000\)) – the number of elements in the array. On the second line – the array itself. It is guaranteed that all array elements are different and do not exceed 10^{9}.

Output

Print a single number – number of bubble sort exchanges.