#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

void setPrime(int *prime , int num)
{
	vector<int> prime_num;
	prime_num.push_back(2);
	prime[2] = 1;
	for (int i = 3; i < num; i++) {
		bool isPrime = true;
		for (int j = 0; j < prime_num.size(); j++) {
			if (i%prime_num[j] == 0)
				isPrime = false;
		}
		if (isPrime) {
			prime_num.push_back(i);
		}
		prime[i] == prime_num.size();
	}
}

int main()
{
	int prime[1000000];
	setPrime(prime, 1000000);
	int n;
	while (cin >> n) {
		cout << prime[n] << endl;
	}
	return 0;
}