#include<cstdio>
#include<cmath>
int N,z,c,i;
int main(){
    for (scanf("%d",&N),c=0;scanf("%d",&z),[](int n){if(n==1)return 0;if(n==2)return 1;for(int i=2;i<=sqrt((double)n);++i)if(n%i==0)return 0;return 1;}(z)?++c:0,--N;);
    printf("%d\n",c);
}