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

#define N 10000
#define TRUE 1
#define FALSE 0

int isprime(int);

int main(){
  int i,j,num,A[N],count=0;

  while(1){
    scanf("%d",&num);
    if(1 <= num && num <= N) break;
  }
  for(i = 0;i < num;i++) scanf("%d",&A[i]);
  for(i = 0;i < num;i++) if(isprime(A[i]) == TRUE) count++;
  printf("%d\n",count);

  return 0;
}

int isprime(int a){
  int i;
  if(a == 2) return TRUE;
  if(a < 2 || a%2 == 0) return FALSE;
  i = 3;
  while(i <= sqrt(a)){
    if(a%i == 0) return FALSE;
    i = i + 2;
  }
  return TRUE;