#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

void Eratosthenes(vector<int> &S_List, vector<int> &P_List){
	vector<int>::iterator it = S_List.begin();
	P_List.push_back(*it);  //先頭を素数リストへ追加
	int num = *it;
	while (it != S_List.end()){
		if ((*it % num) == 0){
			it = S_List.erase(it); //探索リストから倍数を除外
		}
		else{
			++it;
		}
	}
	vector<int>::iterator P_it = max_element(P_List.begin(), P_List.end());
	double p_max_sqr = sqrt(*P_it);
	vector<int>::iterator S_it = max_element(S_List.begin(), S_List.end());
	if (S_List.empty() == true){
		return;
	}
	if (*S_it < p_max_sqr){
		return;
	}
	else{
		Eratosthenes(S_List, P_List);
	}
}


void output(vector<int> ex){
	/*vector<int>::iterator it = ex.begin();
	while(it != ex.end()){
		cout << *it << endl;
		++it;
	}*/
	cout << ex.size() << endl;
}

int main(void){
	int num;
	while (cin >> num){
		vector<int> S_List, P_List;
		for (int i=2; i<=num; ++i){
			S_List.push_back(i);
		} 
		Eratosthenes(S_List, P_List);
		output(P_List);
	}
	return 0;
}