#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);
  }
  int time0 = (int)time(NULL);
  set<long long> primes;
  list<long long>* numbers = new list<long long>();
  long long next_prime = 2;
  for (long long i = next_prime + 1; i <= max; ++i) {
    numbers->push_back(i);
  }
  primes.insert(next_prime);
  int time1 = (int)time(NULL);
  int time2 = (int)time(NULL);
  while (!numbers->empty()) {
    for (list<long long>::iterator i = numbers->begin(); i != numbers->end();
         ++i) {
      if ((*i) % next_prime == 0) {
        i = numbers->erase(i);
      }
    }
    next_prime = numbers->front();
    numbers->pop_front();
    primes.insert(next_prime);
  }
  int time3 = (int)time(NULL);
  int prime_count = 0;
  for (int i = 0; i < size; ++i) {
    if (primes.find(data[i]) != primes.end()) ++prime_count;
  }
  cout << prime_count << endl;
  return 0;
}
