#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] == 2){
  k++;
  }
  if(n[i]%2 !=0 && n[i] != 1){
     i = 3;
    while(i <= sqrt(n[i])){
      r = n[i]%i;
      if(r == 0){
      break;
      }
      i = i + 2;
     }
     if(r != 0){
     k++;
     }
  }
   
}

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

return 0;
}

