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
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
n=input()
c=0
l=[int(i) for i in raw_input().split()]
for i in range(n-1):
	for j in range(i+1,n):
		if l[i]>l[j]:
			c+=1
print c