Count the number of inversions of every given sequence of integer numbers . Remember that an inversion is a pair of indices and such that and .
Input consists of several cases, each one with followed by the integer numbers . Assume .
For every case, print the number of inversions of the sequence.
Input
4 2 3 5 7 4 7 5 3 2 3 -7 -7 -7
Output
0 6 0