#ENGLISHP32. Reverse Pair

Reverse Pair

Description

Given a sequence S of N numbers. How many pairs of indexes I and J are there satisfying that I is less than J and S[i] is greater than S[J]?

Input Format

First line: one positive integers N (N <= 100).
Second line: N positive integers (<= 1000).

Output Format

One integer.

5
4 2 5 3 1
7