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

#define N 1000000
#define TRUE (int)(0==0)
#define FALSE !TRUE
#define BUFLEN 1024
//using std;

int syserr(char *str)
{
  fputs(str, stderr);
  exit(-1);
}
int main(int argc, char *argv[]){
  int f[N];

  memset(f, TRUE, N);
  f[1]=FALSE;
  for (int i=3; i<N; i++){
    if (f[i] == TRUE ) {
      for (int j=i+i; j<N; j+=i){
	f[j] = FALSE;
      }
    }
  }

  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;
    for (int i=1; i<=n; i++){
      if (f[i]){
	m++;
      }
    }

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