#include <iostream>
using namespace std;

int pri[1000000]={0};


int main(){
	
	pri[0]=pri[1]=1;
	for(int i=2;i*i<=999999;i++){
		for(int j=i*2;pri[i]==0&&j<=999999;j+=i){
			pri[j]=1;
		}
	}
	
	int n;
	while(cin>>n){
		int tmp=0;
		for(int i=0;i<=n;i++){
			if(pri[i]==0)tmp++;
		}
		cout<<tmp<<endl;
	}
	
	return 0;
}
