#include <cstdio>
#include <vector>

using namespace std;

int main()
{
	int n;
	vector<int> prime;
	
	for (int i = 3; i < 10000000; i += 2){
		int j;
		for (j = 1; j < prime.size(); j++){
			if (i % prime[j]){
				break;
			}
		}
		if (j >= prime.size()){
			prime.push_back(i);
		}
	}
	while (scanf("%d", &n) != EOF){
		int count;
		
		for (count = 1; prime[count - 1] < n; count++);
		if (n >= 2){
			count++;
		}
		printf("%d\n", count);
	}
	
	return 0;
}