#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); ++i)
#define reps(i,f,n) for(int i=(f); i<=(n); ++i)
#define outl(x) cout<< (x) << '\n'
#define FAST() cin.tie(0), ios::sync_with_stdio(false)
template<class A, class B>inline bool chmax(A &a, B b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, B b){return b<a ? a=b,1 : 0;}
inline int updiv(int a, int b){return((a+b-1) / b);}

bool prime[100000001] = {0,0, 1};

#define SQR(x) ((x)*(x))

int main()
{
    FAST();
    int n, cnt = 0;
    int a[10002];

    cin >> n;
    rep(i, n)cin >> a[i];

    sort(a, a+n);
    const int mx = a[n-1];

    for(int i=3; i<=mx; i+=2)prime[i] = true;

    for(int i=3; i<=mx; i+=2){
        if(prime[i]){
            for(int j=SQR(i); SQR(j)<=mx; j+=i)prime[j] = false;
        }
    }

    rep(i, n){
        cnt += prime[ a[i] ];
    }
    outl(cnt);
}