#include <bits/stdc++.h>
using namespace std;
bool solve(int n) {
  int i = 3;
  bool b = true;
  if (n == 2)
    return true;
  else if (n < 2 || n % 2 == 0)
    return false;
  else {
    while (i <= sqrt(n)) {
      if (n % i == 0) {
        b = false;
        break;
        i += 2;
      }
    }
  }
  if (b) {
    return true;
  } else
    return false;
}
int main() {
  int n, ans = 0;
  while (cin >> n) {
    bool b = solve(n);
    if (b) ans++;
  }
  cout << ans << endl;
  return 0;
}
