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