#include<iostream>
using namespace std;

bool x[1000000];

void pri(int num){
	for(int i = 0; i <= num; i++) cout <<"x["<<i<<"] = "<<x[i]<<endl;
}

void setbool(int num){
	x[0] = false; x[1] = false;
	for(int i = 2; i <= 1000000; i++) x[i] = true;
	for(int i = (num + 1); i <= 1000000; i++) x[i] = false;
}

void loop(int num){
	for(int i = 2; i <= num; i++){
		if(x[i] == false) continue;
		else{
			int j = i;
			while(j < num){
				j++;
				if(x[j] == true && j % i == 0) x[j] = false;
			}
		}
	}
}

int ans(){
	int cou = 0;
	for(int i = 0; i <= 1000000; i++) if(x[i] == true) cou++;
	return cou;
}

int main(){
	int num, cou = 0, i;
	
	while(cin >>num){
		setbool(num);
		loop(num);
		cout <<ans()<<endl;
	}
	
	return 0;
}