import functools, math, itertools def gcd(a): return functools.reduce(math.gcd, a) N = int(input()) A = [int(input()) for _ in range(N)] C = 0 for i in itertools.combinations(A, 3): if gcd(i) == 1: C += 1 print(C)