def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


while True:
    try:
        n = int(input())
        s = input().split(" ")
        num = []
        for i in range(len(s)):
            num.append(int(s[i]))
        sum = 0
        for j in range(len(s)):
            for k in range(j, len(s)):
                if gcd(num[j], num[k]) == 1 and j != k:
                    sum = sum + 1
        print(sum)
    except:
        break