import itertools def gcd(a,b): if b==0: return a return gcd(b,a%b) n=int(input()) a=[int(input()) for i in range(n)] ans=0 for num in itertools.combinations(a,3): tmp=gcd(num[1],num[0]) g=gcd(tmp,num[2]) if g==1: ans+=1 print(ans)