import math from functools import reduce from itertools import combinations def gcd_list(numbers): return reduce(math.gcd, numbers) n = int(input()) a = [int(input())for i in range(n)] count = 0 a_list =list(combinations(a,3)) for i in a_list: if gcd_list(i) ==1: count +=1 print(count)