Given a permutation of the integers to
, print out the number of inversions in the array.
An inversion is defined as a pair of indices, such that
.
Input Specification
The first line will contain the integer
.
The second line will contain integers,
.
It is guaranteed the second line will contain a valid permutation of the integers from to
.
Output Specification
Output the number of inversions in the permutation.
Sample Input
4
3 2 1 4
Sample Output
3
Comments