Two positive integers are called coprime if their only common divisor is 1. Given a sequence of positive integers a1,a2,…,an, count how many pairs of its terms are coprime.
The first line contains one integer n (1≤n≤106), the length of the sequence. The second line contains n integers ai (1≤ai≤3×106), separated by spaces.
Print a single integer: the number of pairs (i,j) with 1≤i<j≤n such that ai and aj are coprime.