import std.stdio;
import std.string;
import std.math;
import std.conv;

void main(){
  const int N=1000000;
  auto p=new bool[N+1];
  for(int i=0;i<=N;++i)p[i]=true;
  p[0]=p[1]=false;
  for(int i=2;i*i<=N;++i){
    if(p[i]){
      for(int j=2;i*j<=N;++j)p[i*j]=false;
    }
  }
  string s;
  while(s=readln.chomp,s!=""){
    int n=to!int(s),count=0;
    for(int i=2;i<=n;++i)if(p[i])++count;
    writeln(count);
  }
  
}