#include<iostream>
#include<boost/multiprecision/miller_rabin.hpp>
#include<boost/random/mersenne_twister.hpp>
namespace mp=boost::multiprecision;

int main(){
    boost::random::mt19937 gen;
    int n;
    std::cin>>n;
    int res;
    for(int i=0;i<n;i++){
        int p;
        std::cin>>p;
        bool isPrime=mp::miller_rabin_test(p,100,gen);
        res+=isPrime;
    }
    std::cout<<res<<std::endl;
    return 0;
}
