#include<stdio.h>
#include<iostream>
using namespace std;

int main(){
	char data[999999];
	
	int i,j,num,check,count = 0;
	
	data[0] = 0;
	data[1] = 1;
	
	for(i=3;i<1000000;i++){
		check = 1;
		if(i%2==0){
			data[i-1]=0;
		}
		if(i%2==1){
			for(j=3;j*j<=i;j+=2){
				if(i%j==0){
					check = 0;
					break;
				}
			}
			if(check == 1){
				data[i-1] = 1;
			}
			else{
				data[i-1] = 0;
			}
		}
	}
	/*
	for(i=0;i<20;i++){
		if(data[i] == 1){
			printf("%d\n",i+1);
		}
	}
	*/
	
	
	while(cin>>num){
		count = 0;
		for(i=0;i<num;i++){
			if(data[i] == 1){
				count++;
			}
		}
		printf("%d\n",count);
	}
	
	
	
	return 0;
}