Score : $300$ points
Given an array of $N$ integers $A=(A_1,A_2,...,A_N)$, find the number of pairs $(i,j)$ of integers satisfying all of the following conditions:
Input is given from Standard Input in the following format:
$N$ $A_1$ $A_2$ $\dots$ $A_N$
Print the answer as an integer.
3 1 7 1
2
In this input, we have $A=(1,7,1)$.
10 1 10 100 1000 10000 100000 1000000 10000000 100000000 1000000000
45
20 7 8 1 1 4 9 9 6 8 2 4 1 1 9 5 5 5 3 6 4
173