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

int main(){
	int  n,i,j,sqrtn,sum;
	while(scanf("%d",&n)!=EOF){
		sum=(n-1)/2;
		for(i=3;i<=n;i+=2){
			sqrtn=(int)sqrt(i);
			for(j=1;j*6-1<sqrtn;j++){
				if(i%(j*6+1)==0 || i%(j*6-1)==0){
					sum--;
					break;
				}
			}
		}
		printf("%d\n",sum);
		
	}
	return 0;
}