#include <bits/stdc++.h>
int isprime(double);
int main() {
  int count, prime = 0;
  int i;
  double num[10000];
  scanf("%d", &count);
  for (i = 0; i < count; i++) {
    scanf("%lf", &num[i]);
  }
  for (i = 0; i < count; ++i) {
    if ((int)num[i] < 2) continue;
    if ((int)num[i] == 2) {
      ++prime;
      continue;
    }
    if ((int)num[i] % 2 == 0) continue;
    if (isprime(num[i]) == 1) ++prime;
  }
  printf("%d", prime);
  return 0;
}
int isprime(double x) {
  int i;
  double N;
  N = sqrt(x);
  while (i < (int)N) {
    if ((int)N % i == 0) return 0;
    i += 2;
  }
  return 1;
}
