Processing math: 100%
Equal pairs - MarisaOJ: Marisa Online Judge

Equal pairs

Time limit: 1000 ms
Memory limit: 256 MB

You are given an array integer A of length n. Find the number of pairs (i,j) that Ai=Aj and i≠j.

Input

  • The first line contains an integer n.
  • The second line contains n integers Ai.

Output

  • One integer is the number of pairs you found.

Constraints

  • 1≤n≤105.
  • 1≤Ai≤105.

Example

Input:

5
1 2 2 1 1

Output:

4