You are given an array a of n distinct positive integers. Find the number of pairs (i,j) with 1≤i,j≤n for which the number a_i2+a_j is a square of an integer.
The first line of the input contains a single integer n (1≤n≤106), the size of the array.
The second line of the input contains n distinct positive integers a_1,…,a_n (1≤a_i≤106).
Output a single integer: the answer to the problem.
In the example, there are two such pairs, corresponding to 12+3=4=22 and 22+5=9=32.