#include <bits/stdc++.h>
int main() {
  const int max = 100000100;
  bool* p;
  p = new bool[max];
  for (int i = 0; i < max; ++i) {
    p[i] = true;
  }
  p[0] = p[1] = false;
  for (int i = 2; i < max; ++i) {
    if (p[i]) {
      for (int j = i * 2; j < max; j += i) {
        p[j] = false;
      }
    }
  }
  int N;
  int temp;
  int ans = 0;
  std::cin >> N;
  for (int i = 0; i < N; ++i) {
    std::cin >> temp;
    if (p[temp]) {
      ans += 1;
    }
  }
  std::cout << ans << std::endl;
  delete[] p;
  return 0;
}
