#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n,kq;
bool kt(ll n)
{
    if(n==1) return false;
    ll tinh=0;
    for(ll i=1;i*i<=n;i++)
    {
        if(n%i==0)
        {
            tinh+=i;
            if(i!=n/i&&i!=1)
            {
                tinh+=n/i;
            }
        }
    }
    if(tinh>n) return true;
    return false;
}
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(NULL);
    if(fopen("TIHON.INP","r"))
    {
        freopen("TIHON.INP","r",stdin);
        freopen("TIHON.OUT","w",stdout);
    }
    cin>>n;
    while(n--)
    {
        ll x;
        cin>>x;
        if(kt(x)) kq++;
    }
    cout<<kq;
}
