#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
using namespace std;

bool judge(int n){
    if(n<=1){return false;}
    for(int i=2;i*i<=n;i++){
        if(n%i==0){return false;}
    }
    return true;
}


int main(){
    int n,a;
    cin>>n;
    int count=0;
    for(int i=0;i<n;i++){
        cin>>a;
        if(judge a){count++;}
    }
    

    cout<<count<<endl;
    
    return 0;
}
