#include <bits/stdc++.h>
int main() {
  int n = 10000;
  int flag[n + 1];
  int ans = 0;
  int i, j;
  for (i = 1; i < n + 1; i++) flag[i] = 1;
  flag[1] = 0;
  for (i = 1; i < sqrt(n + 1); i++) {
    if (flag[i] == 1)
      for (j = 2; i * j < n + 1; j++) flag[i * j] = 0;
  }
  int data;
  static char line[1024];
  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;
}
