#include <bits/stdc++.h>
int main(void) {
  int* list = (int*)malloc(sizeof(int) * 10000000);
  int in;
  int i, j;
  int count = 0;
  int max;
  unsigned sq_num = (int)sqrt((double)10000000);
  for (i = 0; i < 10000000; i++) {
    list[i] = 1;
  }
  list[0] = 0;
  for (i = 1; i < sq_num; i++) {
    if (list[i] == 1)
      for (j = (i + 1); (i + 1) * j <= 10000000; j++) list[(i + 1) * j - 1] = 0;
  }
  scanf("%d", &in);
  max = in;
  while (scanf("%d", &in) != EOF) {
    if (max < in) max = in;
  }
  for (i = 0; i < max; i++) {
    if (list[i] == 1) count++;
  }
  printf("%d\n", count);
  free(list);
  return 0;
}
