#include <stdio.h>

int main(){

int n[10000];
int k,s,i,j,r;


k=0;

scanf("%d\n",&s);

for(i=0;i<s;i++){
 scanf("%d\n",&n[i]);
  
}

for(i=0;i<s;i++){
 if(n[i] == 1){
   k++;
   }
 else if(n[i]%2 !==0 ){
    for(j=3;r!==0 && j<=sqrt(n[i]);j=j+2){
       r = n[i]%j;
       }
    if(r !== 0){
     k++;
    }
   }
}

printf("%d\n",k);

return 0;
}

