#include<iostream>
int main()
{
    int n;
    int cnt=0;
    std::cin>>n;
    int A[n];
    for(int i=0;i<n;i+;){
        std::cin>>A[i];
    }
    int judge=0;
    for(int i=0;i<n;i++){
        for(int j=2;j<=sqrt(A[i]);j++){
            if(A[i]%j==0){
                judge=1;
                break;
            }
        }
        if(judge=1){
            cnt+=1;
            judge=0;
        }
    }
    std::cout>>n-cnt;
    
    return 0;
}
