#include<iostream>
#include<cstdio>
#include<vector>

using namespace std;

vector<int>soe(int n);

int main(void)
{
	int num;
	while(cin >> num){
		vector<int>sosu(num);
		sosu = soe(num);
		int a_size = sosu.size();
		cout << a_size << endl;
		/*for(int i = 1; i < num; i++){
			cout << sosu[i] <<endl;
		}*/
	}	
	return 0;
}

vector<int>soe(int n){
	vector<int>hyo(n);
	for(int i = 2; i < n; i++){ //??\???
		hyo[i] = i;
	}
	for(int i = 2; i*i < n; i++){ //???????????§??°?????????
		if(hyo[i])
		for(int j = i*i; j < n; j += i){
			hyo.erase(remove(hyo.begin(), hyo.end(), j), hyo.end());
		}
	}
	hyo.erase(remove(hyo.begin(), hyo.end(), 0), hyo.end());
	hyo.erase(remove(hyo.begin(), hyo.end(), 1), hyo.end());
	return hyo;
}