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