#include<iostream>
#include<vector>
using namespace std;
int main(){
	int time;
	vector<int> v;
	v.push_back(2);
	v.push_back(3);
	while(cin>>time){
		int abcd=0;
		if(time>v[v.size()-1]){
			for(int abc=1+v[v.size()-1];abc<=time;abc+=2){
				for(int bcd=0;bcd<(int)v.size() ;bcd++){
					if(abc%v[bcd]==0){
						goto end;
					}
				}
				v.push_back(abc);
				end:;
			}
		}
		for(int abc=0;v[abc]<=time;abc++){
			abcd++;
		}
		cout<<abcd<<endl;
	}
	return 0;
}