#include <bits/stdc++.h>
using namespace std;
string s;
int n, a[100000],d,c,i=0,p;
/*
int gtln(int a,int b)
{
    int r;
    while (b!=0)
    {
        r=a%b;
        a=b;
        b=r;
    }
    return a;
}
void ahihi(int a)
{
    int c[100000],m=0,r;
        while (a>0)
        {
            c[m]=a%2;
            a=a/2;
            m++;
        }
        for (int i=m-1;i>=0;i--)
        {
            cout<<c[i];
        }
}
*/
bool check(int a)
{
    int d=0;
    for (int i=2;i*i<=a;i++)
    {
        if (a%i==0)
        {
            d=d+i+a/i;
        }
    }
    if (d+1==a) return true;
    return false;
}
int main()
{
    //freopen("dayso.inp","r",stdin);
    //freopen("SOHH.out","w",stdout);
    cin>>n;
    for (int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for (int i=0;i<n;i++)
    {
        if (check(a[i])==true&&a[i]!=1)
           d++;
    }
    cout<<d;
}

