# coding: utf-8 # Your code here! import sys #sys.setrecursionlimit(10**6) readline = sys.stdin.readline def prime_factorize(N): #素因数分解 exponent = 0 while N%2 == 0: exponent += 1 N //= 2 if exponent: factorization = [[2,exponent]] else: factorization = [] i=1 while i*i <=N: i += 2 if N%i: continue exponent = 0 while N%i == 0: exponent += 1 N //= i factorization.append([i,exponent]) if N!= 1: factorization.append([N,1]) assert N != 0, "zero" return factorization def divisor_list(N): #約数のリスト if N == 1: return [1] res = [] for i in range(1,N): if i*i >= N: break if N%i == 0: res.append(i) res.append(N//i) if i*i == N: res.append(i) return res n = int(input()) a = [int(i) for i in readline().split()] res = set() pres = set() for i in a: res|=set(divisor_list(i)) P = prime_factorize(i) P = [pi[0] for pi in P] pres|=set(P) ans = {i:0 for i in res} for i in a: ans[i] += 1 res = sorted(list(res),reverse=True) for p in pres: for c in res: if c%p==0: ans[c//p] += ans[c] p2 = [1] for i in range(100): p2.append(p2[-1]*2) for i in ans: ans[i] = p2[ans[i]]-1 res = list(reversed(res)) for p in pres: for c in res: if c*p in res: ans[c] -= ans[c*p] print(ans[1])