import sets, sequtils, strutils proc factorize(n: int): HashSet[int] = var x = n i = 2 result = initHashSet[int]() while i * i <= x: if (x mod i) == 0: result.incl i x = x div i else: inc i result.incl x let n = parseInt stdin.readLine a = n.newSeqWith stdin.readLine.parseInt hs = a.map factorize var cnt = 0 for i in 0 ..< n-2: for j in i+1 ..< n-1: for k in j+1 ..< n: if (hs[i] * hs[j] * hs[k]).len == 0: inc cnt echo cnt