#include <bits/stdc++.h>
using namespace std;
unordered_set<int> primes50;
bool is_prime(int n) {
  if (n % 2 == 0 and n != 2) return false;
  if (primes50.count(n) != 0) return true;
  for (int z = 2; z <= ceil(sqrt(n)); ++z) {
    if (n % z == 0) return false;
  }
  return true;
}
int main() {
  for (int i = 2; i < 100; ++i) {
    if (i % 2 == 1 or i == 2) {
      bool considering = true;
      for (int j = 2; j <= ceil(sqrt(i)) and considering; ++j) {
        if (!(i % j)) considering = false;
      }
      if (considering) primes50.insert(i);
    }
  }
  cin.ignore(numeric_limits<streamsize>::max(), '\n');
  int n;
  int count{0};
  while (cin >> n) count += is_prime(n);
  cout << count << endl;
}
