Given an array A of N integers. Find total number of pairs such that i < j and A[i] > A[j].

Constraints

1 ≤ N ≤ 2*10^3

1 ≤ Ai ≤ 10^9

SAMPLE INPUT
5
5 1 2 4 3

SAMPLE OUTPUT
5
n = input(); c = 0;
a = [int(i) for i in raw_input().split()];
for i in range(0, n):
	for j in range(i + 1, n):
		if(a[i] > a[j]):	c += 1;
print c;