def gcd(a, b):#欧几里得算法求最大公约数
    if b==0:
        return a
    else:
        return gcd(b, a%b)

def fenshu(s):
    k=0
    for i in range(len(s)-1):
        for j in range(i+1, len(s)):
            if gcd(s[i], s[j]) == 1:
                k+=1
    return k


while True:
    try:
        n = int(input())
        a = list(map(int, input().split()))
        print(fenshu(a))
    except:
        break