#include <bits/stdc++.h>
int koyaku(int a);
int main() {
  int n, i, c = 0;
  scanf("%d", &n);
  int data[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &data[i]);
  }
  for (i = 0; i < n; i++) {
    if (koyaku(data[i]) == 1) {
      c++;
    }
  }
  printf("%d\n", c);
  return 0;
}
int koyaku(int a) {
  int i;
  if (a < 2 || a % 2 == 0) return -1;
  if (a == 2) return 1;
  i = 3;
  while (i <= sqrt(a)) {
    if (a % i == 0) return -1;
    i = i + 2;
  }
  return 1;
}
