#include<stdio.h>
#include<math.h>
#define N 10000
int naturalnumber(int x);
int main(void){

  int A[N], i, n, j, c=0, s;

  scanf("%d",&n);

  for(i = 0; i < n; i++){
    scanf("%d",&A[i]);
  }

  for(i = 0; i < n; i++){
    s = A[i];
    if(naturalnumber(s) == 1) c++;
  }
  printf("%d\n", c);
}

int naturalnumber(s){
  int j;

  if(s == 2 || s == 3 || s == 5 || s == 7) return 1;
  if(s%2 == 0) return 0;
  for(j = 3; j <= sqrt(s); j += 2){
    if(s%j == 0) return 0;
  }

  return 1;
}