#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
int main() {
  const int candidate_array_size = 10001;
  const int N_max = 10000;
  int N;
  bool prime_table[candidate_array_size];
  int candidates[N_max];
  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> candidates[i];
  }
  int max_candidate = *std::max_element(candidates, candidates + N);
  std::fill(prime_table, prime_table + candidate_array_size, true);
  prime_table[0] = prime_table[1] = false;
  for (int cand = 2; cand * cand <= max_candidate; ++cand) {
    if (prime_table[cand]) {
      for (int nonprime = cand * 2; nonprime <= max_candidate;
           nonprime += cand) {
        prime_table[nonprime] = false;
      }
    }
  }
  int num_of_primes = 0;
  for (int i = 0; i < N; ++i) {
    if (candidates[i] < candidate_array_size) {
      if (prime_table[candidates[i]]) ++num_of_primes;
    } else {
      int j;
      for (j = 2; j < candidate_array_size; ++j) {
        if (prime_table[j] && (0 == candidates[i] % j)) break;
      }
      if (j == candidate_array_size) ++num_of_primes;
    }
  }
  cout << num_of_primes << endl;
  return 0;
}
