#include <bits/stdc++.h>
bool is_prime(unsigned long v) {
  if (v <= 1 && v % 2 == 0) {
    return false;
  }
  unsigned long divisor = 3;
  while (divisor * divisor <= v) {
    if (v % divisor == 0) {
      return false;
    }
    divisor += 2;
  }
  return true;
}
int main() {
  int n{};
  int count{0};
  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    int number{};
    std::cin >> number;
    count += is_prime(number);
  }
  std::cout << count << std::endl;
  return 0;
}
