#include<stdio.h>

int main(void){

int a[10000],b[10000],i,k,n,true,false,ans;
scanf("%d",&n);

for(k=0;k<n;k++){
scanf("%d",&a[k]);

if(a[k]==2)
 true++;
else if((a[k]<2)||(a[k]%2==0))
 false++;
else{
 i=3;
while(i<=sqrt(a[k]){
if(a[k]%i==0)
     break;
    else 
 b[i]++;
 i=i+2;
}
if(b[i]==sqrt(a[i])-2)
true++;
}

}

printf("%d\n",true);
}

