/**
    HOANG HAI DANG
    --------------
    THCS NGUYEN DU
*/
#include<bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define name if(fopen("TIHON.INP","r")) { freopen("TIHON.INP","r",stdin); freopen("TIHON.OUT","w",stdout); }
using namespace std;
ll a[100000005];
bool tuc(ll n)
{
    ll s=0;
    for(ll i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            s+=i;
            if(i!=n/i)
            {
                s+=n/i;
            }
        }
    }
    if(s>n) return true;
    return false;
}
int32_t main()
{
    #ifndef TIHON
    name;
    #endif // TIHON
    fast;
    ll n,dem=0;
    cin>>n;
    for(ll i=1;i<=n;i++)
    {
        cin>>a[i];
        if(tuc(a[i]))
        dem++;
    }
    cout<<dem;
    return 0;
}
