import sys readline=sys.stdin.readline write=sys.stdout.write from math import gcd as GCD import math N=int(readline()) A=[int(readline()) for n in range(N)] se=set() for i in range(N): for j in range(i+1,N): for k in range(j+1,N): if GCD(A[i],A[j],A[k])==1: se.add(tuple(sorted([A[i],A[j],A[k]]))) ans=len(se) print(ans)