5.2 Grown Ups

Score: 60pts

Time Limit: 2.00 sec

Some people hate growing up into adults. (Some believe that with great power i.e age, comes great responsibility and hence they hate the extra burden).

The question is can we find these humans who hate evolution into adults? The almighty God has derived a random algorithm, which is completely wrong, but since he's everyone’s parent, you've to humor him and his crazy algorithm.

He thinks if you are given N humans in an array, A1,A2 ... AN, where each human is denoted by an integer. The total unique pairs in total, each given by (Ai,Aj) where j > i, is the number of humans who hate growing up.

The question is can we find these humans who hate evolution into adults? The almighty God has derived a random algorithm, which is completely wrong, but since he's everyone’s parent, you've to humor him and his crazy algorithm.

He thinks if you are given N humans in an array, A1,A2 ... AN, where each human is denoted by an integer. The total unique pairs in total, each given by (Ai,Aj) where j > i, is the number of humans who hate growing up.

Constraints

1 ≤ N ≤ 2 * 10^5

1 ≤ Ai ≤ 10^9

1 ≤ Ai ≤ 10^9

Input Format

The first line will consist of a single integer N denoting no of humans. The second line consists of N integers A1,A2 ... AN.

Output Format

Output the total number of unique pairs (Ai,Aj) that can be formed, which will also be the number of special Pikachus.

Example 1

Input:

5

1 2 2 1 3

Output:

6

Explanation:

All possible pair combinations are (1,1),(1,2) , (1,3) , (2,1), (2,2), (2,3).

5

1 2 2 1 3

Output:

6

Explanation:

All possible pair combinations are (1,1),(1,2) , (1,3) , (2,1), (2,2), (2,3).