#include <bits/stdc++.h>
using namespace std;
static bool gosei[100000001];
void a() {
  for (int i = 2; i <= sqrt(100000001); i++)
    if (gosei[i] == false) {
      for (int j = 2, k = 0; (k = i * j) <= 100000001; j++) gosei[k] = true;
    }
}
int main() {
  a();
  int b = 0;
  for (int a; cin >> a;)
    if (!gosei[a]) b++;
  cout << b << endl;
  return 0;
}
