import math n = int(input()) A = [int(input()) for _ in range(n)] p = [] for i in range(n): for j in range(i+1, n): for k in range(j+1, n): if math.gcd(A[i], A[j], A[k]) == 1: p.append((A[i], A[j], A[k])) print(len(p))