#include <stdio.h>

int main()
{
	bool *sosu;
	int *ans,now,n;

	sosu = new bool[1000000];
	ans = new int[1000000];

	for(int i = 0; i < 1000000; i++){
		sosu[i] = true;
	}
	sosu[0] = sosu[1] = false;
	for(int i = 0; i < 1000000; i++){
		if(sosu[i] == true){
			for(int j = 2; j*i < 1000000; j++){
				sosu[j*i] = false;
			}
		}
	}
	now = 0;
	for(int i = 0; i < 1000000; i++){
		if(sosu[i] == true)
			now++;
		ans[i] = now;
	}

	while(scanf("%d",&n) != EOF){
		printf("%d\n",ans[n]);
	}

	return 0;
}