#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
int main() {
  const int N_max = 10000;
  int N;
  int candidates[N_max];
  std::vector<int> primes;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> candidates[i];
  }
  int max_candidate = *std::max_element(candidates, candidates + N);
  for (int cand = 2; cand <= max_candidate; ++cand) {
    bool is_a_prime = true;
    for (const int &i : primes) {
      if (0 == cand % i) {
        is_a_prime = false;
        break;
      }
    }
    if (is_a_prime) {
      primes.push_back(cand);
    }
  }
  int num_of_primes = 0;
  for (int i = 0; i < N; ++i) {
    if (std::binary_search(primes.begin(), primes.end(), candidates[i])) {
      ++num_of_primes;
    }
  }
  cout << num_of_primes << endl;
  return 0;
}
