#include <bits/stdc++.h>
using namespace std;

int main(void){
	int n;
	bool* hurui = new bool[1000000];
	fill(hurui,hurui+1000000,true);
	hurui[0]=hurui[1]=false;
	for(int i=2;i<1000;i++){
		if(!hurui[i]) continue;
		for(int j=i*2;j<1000;j+=i)
			hurui[j]=false;
	}
	while(cin>>n){
		cout << count(hurui+1,hurui+1+n,true) << endl;
	}
	delete[] hurui;
}