#include <bits/stdc++.h>
int main() {
  int i, k, sum, frag;
  sum = 0;
  while (scanf("%d", &k) != EOF) {
    if (k == 1 || k == 2) sum++;
    continue;
    if (k % 2 == 0) continue;
    i = 3;
    frag = 0;
    while (i * i <= k) {
      if (k % i == 0) frag = 1;
      break;
      i += 2;
    }
    if (frag = 0) sum++;
  }
  printf("%d\n", sum);
  return 0;
}
