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

using namespace std;\

int main(void)
{
	int n = 1;
	int nMax = 1;
	
	vector<int> vecPrime;
	
	while(cin >> n){
		if(n > nMax){
			for(int i = nMax + 1; i <= n; i++){
				vecPrime.push_back(i);
			}
			nMax = n;
		}
		
		int rootN = floor(sqrt(n));
		for(int i = 2; i <= rootN; i++){
			for(int j = 0; j < vecPrime.size(); j++){
				if(vecPrime[j] % i == 0 && vecPrime[j] != i){
					vecPrime.erase(vecPrime.begin() + j);
					j--;
				}
			}
		}
		
		//素数の数をカウント
		int cnt = 0;
		int sizeVec = vecPrime.size();
		for(int i = 0; i < sizeVec; i++){
			if(vecPrime[i] > n){
				break;
			}
			cnt++;
		}
		cout << cnt << endl;
	}
	
	return 0;
}