import sys sys.setrecursionlimit(1500000) def gcd(a, b): if b == 0: return a else: return gcd(b, a % b) a = [] ans = 0 for _ in range(int(input())): a.append(int(input())) for i in range(len(a)): for j in range(i + 1, len(a)): for k in range(j + 1, len(a)): if gcd(gcd(a[i], a[j]), a[k]) == 1: ans += 1 print(ans)