#include <bits/stdc++.h>
int check(int);
int main() {
  int total, A[10000000], i, num, cnt = 0;
  scanf("%d", &total);
  for (i = 0; i < total; i++) {
    scanf("%d", &A[i]);
  }
  for (i = 0; i < total; i++) {
    num = check(A[i]);
    if (num == 1) cnt++;
  }
  printf("%d\n", cnt);
  return 0;
}
int check(int A) {
  int i;
  if (A == 2) return 1;
  if (A < 2 || A % 2 == 0) return 0;
  while (i < sqrt(A)) {
    if (A % i == 0) return 0;
    i = i + 2;
  }
  return 1;
}
