#include <bits/stdc++.h>
int main(int argc, char* argv[]) {
  int n = 0;
  std::cin >> n;
  std::vector<int> list(n);
  for (int i = 0; i < n; ++i) std::cin >> list[i];
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    bool prime = true;
    for (int j = list[i] - 1; j > 1; --j) {
      if (list[i] % j == 0) prime = false;
    }
    if (prime) ++cnt;
  }
  std::cout << cnt << std::endl;
  return 0;
}
