#include"stdio.h"

int p[1000000];
int i,j,f;
int n;
int ans;

int main(){
	while(scanf("%d",&n)!=EOF){
		ans=0;
		for(i=2;i<=n;i++)p[i]=1;
		for(i=2;i<=n;i++)if(p[i]==1){
			ans++;
			for(j=2;i*j<=n;j++)p[i*j]=0;
		}
		printf("%d\n",ans);
	}
}