#include <bits/stdc++.h>
int is_prim(int input);
int main(int argc, char const *argv[]) {
  int input, n, i, count;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &input);
    if (is_prim(input) == 1) count++;
  }
  printf("%d\n", count);
  return 0;
}
int is_prim(int input) {
  int i;
  if (input == 2) return 1;
  if (input < 2 || input % 2 == 0) return 0;
  i = 3;
  while (i <= sqrt(input)) {
    if (input % i == 0) return 0;
    i = i + 2;
  }
  return 1;
}
