inversions-easy

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

Source: hackerearth | Difficulty: EASY


Solutions: