#include <cstdio>
int d[1000000],c[1000000];
int main() {
	int i,j,r=0,n;
	for(i=2;i<=999999;i++) {
		if(d[i]){c[i]=r;continue;}
		c[i]=++r;
		for(j=i*2;j<=999999;j+=i)d[j]=1;
	}
	while(scanf("%d",&n)!=EOF) {
		printf("%d\n",c[n]);
	}
}