#include <stdio.h>
#include <stdlib.h>

int main(void) {
  int n, *ar, *sum, i, j;
  if((ar = (int*)malloc(sizeof(int) * 1000000)) == NULL) return 1;
  if((sum = (int*)malloc(sizeof(int) * 1000000)) == NULL) return 1;
  for(i = 1; i < 1000000; ++i) ar[i] = 1, sum[i] = 1;
  for(i = 2; i < 1000; ++i) {
    if(ar[i]) for(j = 2; i * j < 1000000; ++j) ar[i * j] = 0;
  }
  for(i = 2; i < 1000000; ++i) sum[i] = sum[i - 1] + ar[i];
  while(scanf("%d", &n) != EOF) {
    printf("%d\n", sum[n]);
  }
  free(ar);
  free(sum);
  return 0;
}
