#include <bits/stdc++.h>
using namespace std;
bool primenum(int p) {
  int cnt = 2;
  double root;
  if (p == 2) {
    return true;
  }
  if (p < 2 or p % 2 == 0) {
    return false;
  }
  root = sqrt((double)p);
  while (cnt < (int)root) {
    if (p % cnt == 0) {
      return false;
    }
    cnt++;
  }
  return true;
}
int main() {
  int prime[10001], i = 0, ptot = 0;
  while (cin >> prime[i]) {
    i++;
  }
  for (int s = 0; s < i; s++) {
    if (primenum(prime[s]) == true) {
      ptot++;
    }
  }
  cout << ptot;
  return 0;
}
