#include <bits/stdc++.h>
using namespace std;
#define TLHAdepzais1tg ios_base::sync_with_stdio(0);cin.tie();cout.tie(0);
#define ll long long
#define N 1000007
#define M 2000000
#define fi first
#define se second
#define pii pair<ll,ll>
#define str string
ll f[M];
bool check(int a)
{
    ll res=0;
    for(int i=1;i*i<=a;i++)
    {
        if(a%i==0)
        {
            if(i*i==a)
                res+=i;
            else
                res+=i+a/i;
        }
    }
    return a<(res-a);
}
int n;
int x,ans=0;
int main()
{
    TLHAdepzais1tg;
    if(fopen("tihon.inp","r"))
    {
        freopen("tihon.inp","r",stdin);
        freopen("tihon.out","w",stdout);
    }
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        if(check(x))
            ans++;
    }
    cout<<ans;
    return 0;
}

