#include <bits/stdc++.h>
namespace Wheel {
static constexpr uint64_t miniprimes[] = {2, 3, 5, 7, 11, 13};
static std::vector<int> diff;
struct Initializer {
  Initializer() {
    uint64_t prev = 17;
    for (uint64_t i = 17 + 1; i <= 17 + 2 * 3 * 5 * 7 * 11 * 13; ++i) {
      auto checker = [](uint64_t i) {
        for (uint64_t p : miniprimes) {
          if (i % p == 0) return true;
        }
        return false;
      };
      if (checker(i)) continue;
      diff.push_back(i - prev);
      prev = i;
    }
  }
} initializer;
static bool isprime(uint64_t x) {
  for (uint64_t p : miniprimes) {
    if (p == x) return true;
    if (x % p == 0) return false;
  }
  assert(x >= 17);
  for (uint64_t p = 17;;) {
    for (std::size_t k = 0; k < diff.size(); ++k) {
      if (x == p) return true;
      if (x % p == 0) return false;
      p += diff[k];
      if (p >= (1ULL << 32)) return true;
      if (p * p > x) return true;
    }
  }
  return true;
}
};  // namespace Wheel
int main() {
  int n;
  scanf("%d", &n);
  int res = 0;
  for (int i = 0; i < n; ++i) {
    uint64_t x;
    scanf("%lu", &x);
    if (Wheel::isprime(x)) res += 1;
  }
  printf("%d\n", res);
  return 0;
}
