#include using namespace std; #define fi first #define se second #define pb push_back using vi = vector ; using ll = long long; using vl = vector ; using pii = pair ; //~ const ll mod = 998244353; const ll mod = 1e9 + 7; ll qpow(ll a, ll b, ll m = mod) { ll r = 1, t = a; for(; b; b /= 2) { if(b & 1) r = r * t % m; t = t * t % m; } return r; } const int N = 55; int a[N]; int mu(int x, set ps) { int r = 1; for(int p : ps) { int c = 0; while(x % p == 0) { x /= p; c ++; } if(c >= 2) r = 0; if(c == 1) r *= -1; } return r; } int main() { ios :: sync_with_stdio(false); int n; cin >> n; map mp; for(int i = 1; i <= n; i ++) { cin >> a[i]; set ps; int x = a[i]; for(int j = 2; j * j <= x; j ++) if(x % j == 0) { ps.insert(j); while(x % j == 0) x /= j; } if(x > 1) ps.insert(x); x = a[i]; for(int j = 1; j * j <= x; j ++) if(x % j == 0) { mp[j] = mu(j, ps); mp[x / j] = mu(x / j, ps); } } ll ans = 0; for(auto [d, mu] : mp) { int cnt = 0; for(int i = 1; i <= n; i ++) if(a[i] % d == 0) cnt ++; ans += mu * ((1LL << cnt) - 1); } cout << ans << '\n'; }