#include <bits/stdc++.h>
using namespace std;
int main() {
  bool prime[10005] = {1, 1, 0};
  for (int i = (0); i < (10005); i++) {
    if (!prime[i]) {
      for (int j = i + i; j <= 10005; j += i) {
        prime[j] = 1;
      }
    }
  }
  int ans = 0, x;
  while (cin >> x) {
    if (!prime[x]) ans++;
  }
  cout << ans << endl;
}
