#include <bits/stdc++.h>
unsigned char flag[10000001] = {0};
static char line[1024];
int main() {
  int ans = 0;
  int i, j;
  int k = 0;
  for (i = 1; i < 10000001; i++) flag[i] = 1;
  flag[0] = 0;
  flag[1] = 0;
  for (i = 2; i < sqrt(10000001); i++) {
    if (flag[i] == 1) {
      for (j = 2; i * j < 10000001; j++) {
        flag[i * j] = 0;
      }
    }
  }
  int data;
  while (fgets(line, sizeof(line), stdin) != NULL) {
    if (sscanf(line, "%d", &data) != 1) {
      fputs("sscanf: Convert error\n", stderr);
      return EXIT_FAILURE;
    }
    if (flag[data] == 1) {
      ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
