Question
Rod Count

In a village, Kael has M rods, each with length Bi for the ith rod. A rod of length Bi can be cut to any length Y where Bi % Y == 0, resulting in Z possible lengths, where Z is the number of divisors of Bi. Find the total number of unordered rod pairs that share the same Z value.

Input
The first line of the input contains a single integer M.
The second line of the input contains M space-separated integers.
Output
Print the total number of unordered pair of rods whose Z value is the same.
Example
Sample Input
3
4 9 2
Sample Output
1
Explaination
Rods of length 4 and 9 both have Z value = 3.

Online