#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

void extendPrim(vector<int> &prims,int n){
	if(prims.back()>=n)return;
	int i = prims.back();
	while(i++ <=n){
		for(auto it=prims.begin();it!=prims.end();it++){
			if(i % *it==0){break;}
			if(*it * *it > i){prims.push_back(i);break;}
		}
	}
}

int main(){
	vector<int> vec={2};
	//extendPrim(vec,100);
	int n;
	
	while(cin>>n){
		extendPrim(vec,n);
		auto i = lower_bound(vec.begin(),vec.end(),++n);
		cout << i-vec.begin() << endl;
	}

	return 0;
}