#include<iostream>
#include<string>
#include<math.h>
using namespace std;
int main(){
	int n,a[9];
	a[0]=9592;
	a[1]=17984;
	a[2]=25997;
	a[3]=33860;
	a[4]=41538;
	a[5]=49098;
	a[6]=56543;
	a[7]=63951;
	a[8]=71274;
	while(cin>>n){
		int count=0;
		int i=0;
		while(true){
			if((i+1)*100000<=n)
				count=a[i];
			else
				break;
			i++;
		}
		if(n<100000){
			count=1;
			for(int j=3;j<=n;j++){
			bool t=false;
			for(int k=2;k<1+(double)sqrt((double)j);k++){
				if(j%k==0)
					t=true;
			}
			if(t==false)
				count++;
		    }
		}
		else{
		    for(int j=(i)*100000+1;j<=n;j++){
			    bool t=false;
			    for(int k=2;k<1+(double)sqrt((double)j);k++){
				    if(j%k==0)
				        t=true;
			    }
			    if(t==false)
				    count++;
		    }
		}
		cout<<count<<endl;
	}
	return 0;
}