#include<stdio.h>
#include<stdlib.h>
#include<math.h>

int isprime(int m);

int main(){
  int i,x,n,count = 0,k;
  int *m;

  scanf("%d",&n);
  m = malloc(sizeof(int) * n);
  for(i = 0 ; i < n ; i++)
    {
      scanf("%d",&m[i]);
      k = m[i];
      //fprintf(stderr,"m: %d k: %d\n",m[i],k);
      if((isprime(k)) == 1){
	count++;}
    }
  printf("%d\n",count);
  free(m);
  return 0;
}

int isprime(int x){
  int i=3;
  
  if(x == 2){
    return 1;
  }
  if(x < 2 && x%2 == 0){
    return 2;
  }
  while( i <= sqrt(x))
    {
      if(x%i == 0) return 2;
      i = i +2;
    }

  return 1;
}