#include using namespace std; using lint = long long; template using V = vector; template using VV = V< V >; template V divisor(Z n) { V res; Z i; for (i = 1; i * i < n; ++i) if (n % i == 0) res.push_back(i), res.push_back(n / i); if (i * i == n) res.push_back(i); sort(begin(res), end(res)); return res; } V<> sieve(int n) { V b((n + 1) / 3, true); V<> res{2, 3}; for (int p = 5, d = 2; p * p < n; p += d, d = 6 - d) if (b[p / 3]) { for (int i = 5 * p, e = 2 * p; i < n; i += e, e = 6 * p - e) b[i / 3] = false; } for (int p = 5, d = 2; p < n; p += d, d = 6 - d) if(b[p / 3]) res.push_back(p); while (!res.empty() and res.back() >= n) res.pop_back(); return res; } // ps = sieve(n) template void ifmult(V& a, const V<>& ps) { int n = a.size(); for (int p : ps) { for (int i = 1; i * p < n; ++i) { a[i] -= a[i * p]; } } } constexpr int L = 1e8; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; V c(L + 1); for (int _ = 0; _ < n; ++_) { int a; cin >> a; for (int d : divisor(a)) { ++c[d]; } } for (auto&& e : c) if (e) { e = (1LL << e) - 1; } ifmult(c, sieve(L)); cout << c[1] << '\n'; }