#include <stdio.h>
#include <math.h>

int main(){
	int n,i,j,sqrtn,sum,flag;
	char number[1000000];
	while(scanf("%d",&n)!=EOF){
		for(i=0;i<n;i++){
			number[i]=0;
		}
		sum=0;
		for(i=3;i<=n;i+=2){
			if (number[i]==1){
				continue;
			}
			sqrtn=(int)sqrt(i);
			flag=0;
			for(j=1;j*6-1<sqrtn;j++){
				if(i%(j*6+1)==0 || i%(j*6-1)==0){
					flag=1;
					break;
				}
			}
			if(flag==0){		/*ツ素ツ青板つカツづ。ツづ按つ「ツづ個づ可フツδ可グツづーツ猟ァツづづつュツづヲ*/
				sum++;
				for(j=i;j<n;j+=i){
					number[i]=1;
				}
			}
		}
		printf("%d\n",sum);
		
	}
	return 0;
}