#include <bits/stdc++.h>
short is_prime_number(unsigned long x) {
  unsigned long max, i;
  max = (unsigned long)sqrt((double)x);
  if (x == 1) return 0;
  if (x == 2) return 1;
  if (x % 2 == 0) return 0;
  for (i = 3; i <= max; i += 2)
    if (x % i == 0) return 0;
  return 1;
}
int main(void) {
  unsigned int n, n_prime = 0, i;
  unsigned long x;
  scanf("%u", &n);
  for (i = 0; i < n; ++i) {
    scanf("%lu", &x);
    if (is_prime_number(x)) ++n_prime;
  }
  printf("%u", n_prime);
  return 0;
}
