#include <bits/stdc++.h>
using namespace std;
const int N = 10000;
void primeNumber(bool prime[N]) {
  for (int i = (0); i < (N); i++) prime[i] = 1;
  prime[0] = prime[1] = 0;
  for (int i = (0); i < (N); i++) {
    if (prime[i]) {
      for (int j = i + i; j < N; j += i) {
        prime[j] = 0;
      }
    }
  }
}
int main() {
  bool prime[N];
  int sum = 0;
  primeNumber(prime);
  for (int n; cin >> n;) {
    sum += static_cast<int>(prime[n]);
  }
  cout << sum << endl;
}
