#include <bits/stdc++.h>
using namespace std;
int main() {
  long long max = 0;
  int size = 0;
  cin >> size;
  long long* data = new long long[size];
  for (int i = 0; i < size; ++i) {
    cin >> data[i];
    max = std::max(data[i], max);
  }
  std::map<long long, int> primes;
  primes[1] = 0;
  long long next_prime = 2;
  primes[next_prime] = 1;
  while ((long long)primes.size() != max) {
    for (long long i = next_prime + 1; i <= max; ++i) {
      if (primes.find(i) != primes.end()) {
        continue;
      }
      if (i % next_prime == 0) {
        primes[i] = 0;
      }
    }
    for (long long i = next_prime + 1; i <= max; ++i) {
      if (primes.find(i) == primes.end()) {
        next_prime = i;
        primes[next_prime] = 1;
        break;
      }
    }
  }
  int prime_count = 0;
  for (int i = 0; i < size; ++i) {
    if (primes[data[i]] == 1) ++prime_count;
  }
  cout << prime_count << endl;
  return 0;
}
