#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll a[1000005];
ll n,dem=0;
bool kt(ll n)
{
    ll tong=0;
    for(int i=1;i*i<=n;i++)
        if(n%i==0)
        {
            if(i!=n/i)
                tong+=i+n/i;
            else tong+=i;
        }
    if(tong-n>n)
        return 1;
    return 0;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie();cout.tie(0);
    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>>a[i];
    for(int i=1;i<=n;i++)
        if(kt(a[i]))
        dem++;
    cout<<dem;
}
