#include<stdio.h>
int main(void){
	int i,j,n;
	bool judge[1000000]={0};
	
	for(i=3; i<1000000; i++)if(i % 2 == 0)judge[i] = 1;
	
	for(i=3; i<500000; i+=2){
		if(judge[i]==0){
			for(j=i*2;j<1000000;j+=i){
				if(j % i == 0){
					judge[j]=1;
				}
			}
		}
	}
	
	while(scanf("%d",&n) != EOF){
		int count=0;
		for(i=3;i<=n;i+=2){
			if(judge[i]==0)count++;
		}
		printf("%d\n",count+1);
	}
	return 0;
}