#include <bits/stdc++.h>
using namespace std;
vector<int> primes{2, 3, 5, 7};
void genPrimes(int max) {
  for (int n = 11; n < max; n += 2) {
    bool isprime = true;
    for (auto& a : primes) {
      if (n % a != 0) continue;
      isprime = false;
      break;
    }
    if (isprime) primes.emplace_back(n);
  }
}
int main() {
  genPrimes(10000);
  int nb;
  cin >> nb;
  std::vector<int> lines;
  lines.resize(nb);
  for (auto& a : lines) cin >> a;
  int counter = 0;
  for (auto& a : lines)
    if (count(primes.begin(), primes.end(), a)) counter++;
  cout << counter;
}
