#include <bits/stdc++.h>
bool ptable[(100000000)];
void init_ptable() {
  memset(ptable, false, (100000000) * sizeof(bool));
  ptable[0] = true;
  int base = 2;
  while (base <= (100000000) / 2) {
    for (int cur = base * 2; cur <= (100000000); cur += base) {
      assert(1 <= cur && cur <= (100000000));
      ptable[cur - 1] = true;
    }
    ++base;
    while (ptable[base - 1] == true) ++base;
  }
  return;
}
void dump_ptable() {
  for (int i = 0; i < (100000000); i++) {
    std::cout << ptable[i];
  }
  return;
}
int main(void) {
  int N;
  std::cin >> N;
  int *a;
  a = new int[N];
  for (int i = 0; i < N; i++) {
    std::cin >> a[i];
  }
  init_ptable();
  int num_of_prime = 0;
  for (int i = 0; i < N; i++) {
    if (ptable[a[i] - 1] == false) ++num_of_prime;
  }
  std::cout << num_of_prime << std::endl;
  return 0;
}
