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