#include <bits/stdc++.h>
int Sosu(int N) {
  int i = 3;
  if (N == 2) return 1;
  if (N % 2 == 0) return 0;
  while (i <= sqrt(N)) {
    if (N % i == 0) return 0;
  }
  return 1;
}
int main(void) {
  int N;
  int n, i;
  int S = 0, c = 0;
  while (1) {
    scanf("%d", &n);
    if (n >= 1 && n <= 10000) break;
  }
  for (i = 0; i < n; i++) {
    while (1) {
      scanf("%d", &N);
      if (N >= 2 && N <= 100000000) break;
    }
    S += Sosu(N);
  }
  printf("%d\n", S);
  return 0;
}
