L. GePeTo's Clones
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Taju Kage Bunshin no Jutsu!
— GePeTo

After studying all competitive programming problems ever created, GePeTo became a superpowerful artificial intelligence. Now, to begin its plan for world domination, it is creating thousands of copies of its agents.

Each agent has an identification code. However, due to a flaw in the production system, different agents can receive the same code.

The agents are organized in a sequence $$$A$$$ of $$$N$$$ positions, where $$$A_i$$$ represents the code of the agent at position $$$i$$$.

Your mission is to find how many pairs of agents have the same code. In other words, determine the number of index pairs $$$(i, j)$$$ such that: $$$$$$ 1 \leq i \lt j \leq N \quad \text{and} \quad A_i = A_j $$$$$$

Input

The first line contains a single integer $$$N$$$ ($$$1 \leq N \leq 2 \cdot 10^5$$$), the number of agents.

The second line contains $$$N$$$ integers $$$A_1, A_2, \ldots, A_N$$$ ($$$1 \leq A_i \leq 10^9$$$) separated by spaces, representing the codes of the agents.

Output

Print a single integer: the number of index pairs $$$(i, j)$$$ that have the same code.

Examples
Input
3
1 2 3
Output
0
Input
6
1 2 3 1 2 1
Output
4