#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll a[1000005];
void sang(){
    for(int i = 1;i <= 1000 ;i++){
        a[i*i] += i;
        for(int j = i*i+i;j <= 1000000 ;j+=i)a[j] += i+j/i;
    }
}
int tu(int n){
    int s = 0;
    for(int i = 1;i*i <= n;i++){
        if(n % i == 0){
            s += i;
            if(i != n/i)s += n/i;
        }
    }
    return s;
}
int dem;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    if(fopen("TIHON.INP","r")){
        freopen("TIHON.INP","r",stdin);
        freopen("TIHON.OUT","w",stdout);
    }
    int n;cin >> n;
    sang();
    for(int i = 1;i <= n;i++){
        int x;cin >> x;
        if(x <= 1000000){
            if(a[x] > 2*x)dem++;
        }
        else{
            if(tu(x) > 2*x)dem++;
        }
    }
    cout << dem;
    return 0;
}
