import collections import math def prime_factorize(n): a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) a = list(set(a)) m=1 for i in a: m*=i return m N = int(input()) A = list(map(int,input().split())) d = collections.defaultdict(int) for a in A: nd = collections.defaultdict(int) a = prime_factorize(a) for k,v in d.items(): p = math.gcd(a,k) if p>1: nd[p]+=d[k] for k,v in d.items(): nd[k]+=v if a>1: nd[a]+=1 d = nd s = 0 for k,v in d.items(): s+=v print(2**N-1-s)