#include <bits/stdc++.h>
using namespace std;

#define N 1000001

int main() {

	vector<bool> check(N, false);
	vector<long long> prime;
	
	
	for(long long i = 2; i < N; ++i){
		if(!check[i]) prime.push_back(i);
		for(long long j = 2; i * j < N; ++j){
			check[i * j] = true;
		}
	}
	
	int n;
	
	while(cin >> n){
		auto it = lower_bound(prime.begin(), prime.end() , n+1);
		
		cout << distance(prime.begin(), it) << endl;
	}

	return 0;
}
