#include <bits/stdc++.h>
#define ll long long
#define N 1000003
#define ok "TIHON"
#define fi first
#define se second
#define pb push_back
#define pii pair <int,int>
#define mp make_pair
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define name if (fopen(ok".INP","r")){ freopen(ok".INP","r",stdin); freopen(ok".OUT","w",stdout);}
using namespace std;
ll n,a[N],d=0;
bool kt(ll x)
{
    ll s=0;
    for (ll i=1;i*i<=x;i++)
    {
        if (x%i==0)
        {
            if (i*i==x) s+=i;
            else s+=i+x/i;
        }
    }
    return x<s-x;
}
int main()
{
    fast name
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        cin>>a[i];
        if (kt(a[i])) d++;
    }
    cout<<d;
    return 0;
}
