#include <bits/stdc++.h>
int main() {
  int n;
  int count;
  std::vector<int> d;
  std::cin >> n;
  int tmp;
  for (int i = 0; i < n; i++) {
    std::cin >> tmp;
    d.push_back(tmp);
  }
  count = 0;
  int f;
  for (auto it = d.begin(); it != d.end(); ++it) {
    f = 0;
    for (int i = 2; i <= (int)std::sqrt(*it) && f == 0; i++) {
      if (*it % i == 0) f = 1;
    }
    if (f == 0) count++;
  }
  std::cout << count;
  return 0;
}
