/*
Volume0-0009
*/
#include <stdio.h>
#include <stdlib.h>

#define N 999999
#define M (999999/2)
#define TRUE (char)(0==0)
#define FALSE !TRUE
#define BUFLEN 1024

int syserr(char *str)
{
  fputs(str, stderr);
  exit(-1);
}

int main(int argc, char *argv[]){
  char *f;
  if ((f = (char *)malloc(M*sizeof(char)))==NULL)
    syserr((char *)"malloc");

  for (int i=0; i<M; i++){
    f[i] = TRUE;
  }
  for (int i=3; i<N; i+=2) {
    if (f[i/2-1] == TRUE ) {
      for (int j=i+2*i; j<N; j+=2*i){
	f[j/2-1] = FALSE;
      }
    }
  }
  int x = 1;
  for (int i=3; i<N; i+=2) {
    if (f[i/2-1]) {
      x = x + 1;
    }
    f[i/2-1]=x;
  }
  char buf[BUFLEN];
  while (fgets(buf,BUFLEN, stdin) != NULL){
    int n = atoi(buf);
    int m=0;
    if (n==2){
      m = 1;
    } else if (n % 2 == 0) {
      m = f[(n-1)/2 - 1];
    } else {
      m = f[n/2 - 1];
    }

    printf("%d\n", m);
  }

  exit(0);
}