Jhakaas, recently being fascinated by prime numbers came up with a problem and asked Apptica to solve it. Apptica is working on Machine Learning Project and passed it to Altaireon to solve.
He is given an array A of N integers and the definition of two functions g and f as follows:
g(i,j)=Number of unique common prime factors between Ai and Aj
f(i,j)=1 if g(i,j)≤1 otherwise 0
You are Altaireon, and now you have to calculate
∑f(i,j) such that 1≤i<j≤N
Input:
First line contains N, size of the array A. Next line contains N space separated positive integers, denoting elements of A.
Output:
Print a single integer, denoting the required answer.
Constraints:
2≤N≤3⋅105
1≤Ai≤3⋅104
f(1,2)=1
f(1,3)=1
f(1,4)=1
f(2,3)=1
f(2,4)=1
f(3,4)=0
So, output=1+1+1+1+1+0=5