int main(){
  int x,cnt=0;

  while(scanf("%d",&x)!=0){
    if(isprime(x)==1){
      cnt++;
    }
  }

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

  return 0;
}


int isprime(int x){
  int i;

  //2 is prime number
  if(x==2) return 1;

  //odd-numbers is not prime number;
  if(x<2 || (x%2)==0) return 0;

  i = 3;
  while(i<=sqrt(x)){
    if((x%i)==0) return 0;

    i = i + 2;
  }

  return 1;
}