#include <stdio.h>
#include <math.h>

int judgeprime(long num){
  int primeflag=1,i;

  if(num%2==0){primeflag=0;}
  else for(i=3;i<sqrt(num);i+=2){

    if( num%i==0 ){
      primeflag=0;
      break;
    }

  }

  if(num==0||num==1||num==4){primeflag=0;}
  else if(num==2){primeflag=1;}

  return primeflag;

}

int main(void){
  long i,num;
  int much;

  while( scanf("%ld",&num) != -1 ){

    much=0;

    for(i=1;i<=num;i++){
      much+=judgeprime(i);
    }

    printf("%d\n",much);

  }

  return 0;  
}
04:57:02 ~/programming/AOJ 
$