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

void judge(int num){
  int j = 3;
  if (num==2) {
    return 1;
  } else if (num<2 || num%2==0) {
    return 0;
  } else {
    while (j<=sqrt(num)) {
      if (num%j==0)
        return 0;
      j=j+2;
    }
    return 1;
  }
}

int main(){
  int n, Num, i;
  int count = 0;
  scanf("%d", &n);

  for (i=0; i<n; i++) {
    scanf("%d", &Num);
    judge(Num);
    if (judge(Num)==1)
      count++;
  }

  printf("%d\n", count);
  return 0;
}