#include<cstdio>
#include<cstring>
int main(){
	int a,b,d;
	while(~scanf("%d",&a)){
		int c[a+1];
		memset(c,0,sizeof(c));
		d=0;
		for(b=2;b<=a;b++){
			if(c[b]==0){
				d++;
				for(int i=b;i<a+1;i+=b)	c[i]=1;
			}
		}
		printf("%d\n",d);
	}
}