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

long long n;
vector<long long> p(1, 2);

int main()
{
	for (long long i = 3; i < 1000000; i += 2) {
		long long j = 0;
		bool f = 1;
		while(p[j] * p[j] <= i){
			if (i % p[j] == 0) {
				f = 0;
				break;
			}

			j++;
		}

		if (f)
			p.push_back(i);
	}

	while (cin >> n) {
		int m = 0;

		while (m < p.size() && p[m] <= n)
			m++;

		cout << m << endl;
	}

	return 0;
}
