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


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

int main(void){

  int j,t,m;
  int A[N];
  scanf("%d",&t);
 for(j = 0 ; j < t ; j++){
    scanf("%d",&A[j]);
   if(isprime(A[j]) == 1) m = m + 1;
  }
  printf("%d\n",m);
  return 0;
}