#include <stdio.h>
  
int main(){
 int n,primes=0;
 scanf("%d", &n);
 for(int i=0;i<n;i++){
  int num;
  scanf("%d", &num);
  if(num>2&&(!(num%2))){
   continue;
  }
  for(int w=3;w*w<=num;w+=2){
   if(!(num%w)){
    i++;
    goto NEXT_N;
   }
  }
  primes++;
NEXT_N:
 }
 printf("%d\n",primes);
 return 0;
}