#include <bits/stdc++.h>
using namespace std;
bool PrimeNumbers(int x) {
  bool Num[x + 1];
  Num[0] = false;
  Num[1] = false;
  for (int i = 2; i <= x; i++) {
    Num[i] = true;
  }
  for (int i = 2; i <= sqrt(x); i++) {
    if (Num[i] == true) {
      for (int j = i; j <= x / i; j++) Num[j * i] = false;
    }
  }
  return Num[x];
}
int main() {
  int num;
  int count = 0;
  while (cin >> num) {
    if (PrimeNumbers(num)) count++;
  }
  cout << count << endl;
  return 0;
}
