#include <bits/stdc++.h>
using namespace std;
vector<int> split(string line) {
  vector<int> res;
  stringstream ss;
  ss << line;
  int x;
  while (ss >> x) {
    res.push_back(x);
  }
  return res;
}
bool prime(int x) {
  bool t = false;
  for (int i = 2; i <= sqrt(x); i++)
    if (x % i == 0) t = true;
  return t;
}
int main() {
  string s;
  vector<int> v;
  int sum = 0;
  while (getline(cin, s)) {
    v = split(s);
    for (int i = 0; i < v.size(); i++)
      if (prime(v[i]) == false) {
        sum = sum + 1;
      }
  }
  cout << sum;
  return 0;
}
