import math N = int(input()) A = [int(input()) for _ in range(N)] cnt = 0 for i in range(N): for j in range(i+1, N): g = math.gcd(A[i], A[j]) for k in range(j+1, N): g2 = math.gcd(g, A[k]) if g2==1: cnt+=1 print(cnt)