ll n,z,a[100];{rd(n,a(n));REP(i,n)rep(j,i)rep(k,j)z+=gcd(a[i],a[j],a[k])<2;wt(z);}