from math import gcd n=int(input()) a=[int(input()) for _ in range(n)] ans=0 buf=0 for i in range(n-2): for j in range(i+1,n-1): buf=gcd(a[i],a[j]) for k in range(j+1,n): if gcd(buf,a[k])==1:ans+=1 print(ans)