#include<stdio.h>
#include<math.h>
 
static const int N = 10000;
 
int isPrime(int x){
  int i;
  if(x == 2) return 1;
 
  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;
}
 
int main(){
  int i,n,cnt=0,t;
  int A[N+1];
 
  scanf("%d",&n);
  for(i=0;i<n;i++){
      scanf("%d",&A[i]);
  }
    for(i=0;i<n;i++){
      t = isPrime(A[i]);
      if(t == 1) cnt++;
  }
    printf("%d\n",cnt);
     
    return 0;
}