#include <bits/stdc++.h>
using namespace std;
struct edge {
  int from, to, cost;
  bool operator<(const edge& e) const { return cost < e.cost; }
  bool operator>(const edge& e) const { return cost > e.cost; }
};
bool isprime(int n) {
  for (int i = 2; i * i < n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  int n;
  vector<int> v;
  while (cin >> n) {
    if (isprime(n)) v.push_back(n);
  }
  cout << v.size() << endl;
  return 0;
}
