#include<cstdio>
unsigned a,n,c;
inline bool isp(unsigned a){
    if(a==2)return true;
    for(int i=2;i*i<=a;++i)if(a%i==0)return false;
    return true;
}
int main(){
    scanf("%d",&n);
    for(int i=0;i<n;++i){
        scanf("%d",&a);
        if(isp(a))++c;
    }
    printf("%d\n",c);
    return 0;
}
