#include <bits/stdc++.h>
const int LIMIT = 10000;
void eratosthenes(int n, bool *primes) {
  double root_n = std::sqrt((double)n);
  for (int i = 2; i <= n; ++i) primes[i] = true;
  for (int i = 2; i <= root_n; ++i)
    if (primes[i])
      for (int j = i * i; j <= n; j += i) primes[j] = false;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  bool primes[LIMIT + 1];
  int n, a, cnt = 0;
  std::cin >> n;
  eratosthenes(LIMIT, primes);
  for (int i = 0; i < n; ++i) {
    std::cin >> a;
    if (primes[a]) ++cnt;
  }
  std::cout << cnt << std::endl;
}
