import math n=int(input()) a=list() for i in range(n): a.append(int(input())) ans=0 for i in range(n): for j in range(i+1,n): t=math.gcd(a[i],a[j]) for k in range(j+1,n): if math.gcd(t,a[k])==1:ans+=1 print(ans)