#include <stdio.h>
#include <math.h>
#define N 10000
int isprime(double x);

int main(){
  int num[N],i=0,j,count=0,n;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    if (scanf("%d",&num[i])==EOF) break;
    count+=isprime((double)num[i]);
    
  }  
    printf("%d\n",count);
    return 0;
  
}

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