import sys readline = sys.stdin.readline def divi(n): res = [] for i in range(1, int(n**0.5)+1): if n % i == 0: res.append(i) if i != n // i: res.append(n//i) return res from collections import Counter Ma = 10**8 + 2 prime = [0]*Ma for i in range(2, Ma): if prime[i]: continue for j in range(i, Ma, i): if not prime[j]: prime[j] = i def pd(x): C = Counter() while x > 1: C[prime[x]] += 1 x //= prime[x] return C N = int(readline()) A = list(map(int, readline().split())) divis = set() for a in A: divis |= set(divi(a)) divis = list(divis) print(divis) res = 0 for d in divis: C = pd(d) if any(1 < c for c in C.values()): continue cnt = sum(1 for a in A if a % d == 0) res += (-1)**len(C) * (pow(2, cnt) - 1) print(res)