#include <bits/stdc++.h>
using namespace std;
int main(void) {
  vector<bool> p;
  for (int i = 0; i < 100000000 + 1; i++) p.push_back(true);
  p[0] = false;
  p[1] = false;
  for (int i = 2; i < 100000000 + 1; i++)
    for (int j = i * 2; j < 100000000 + 1; j += i) p[j] = false;
  int n, ans = 0;
  while (scanf("%d", &n) != EOF)
    if (p[n]) ans++;
  cout << ans << endl;
  return 0;
}
