#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <ctime>
#include <cstdlib>
#include <cstdio>

using namespace std;

void Eratosthenes(vector<int> &S_List, vector<int> &P_List){
	while(1){
		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){
		/*clock_t start = clock(); */
		vector<int> S_List, P_List;
		if (num < 4){
			for (int i=2; i<num; ++i){
				S_List.push_back(i);
			}
		}
		else{
			int c = 1;
			S_List.push_back(2);
			S_List.push_back(3);
			while((6*c+1) <= num){
				S_List.push_back(6*c-1);
				S_List.push_back(6*c+1);
				++c;
			}
			if (6*c-1 <= num){
				S_List.push_back(6*c-1);
				}
		}
		Eratosthenes(S_List, P_List);
		output(P_List);
		/*clock_t end = clock();
		printf("%.4f[sec]\n",(double)(end-start)/CLOCKS_PER_SEC);*/
	}
	return 0;
}