def gcd(a,b):
    if b==0: return a
    else: return gcd(b,a%b)

while True:
    try:
        times=int(input())
        list1=list(map(int,input().strip().split()))
        if times==0: continue
        count=0
        for i in range(times):
            for j in range(i,times,1):
                gc=gcd(list1[i],list1[j])
                if (gc==1):
                    count+=1
        print(count)
    except EOFError:
        break