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

int main(void)
{
	int n;

	while (std::cin >> n) {
		std::vector<int> p(n + 1, 0);
		p[0] = p[1] = 1;
		int m = 0;

		for (int i = 1; i <= std::sqrt(n); i++) {
			if (p[i]) continue;
			m++;
			for (int j = i; j <= n; j+=i)
				p[j] = 1;
		}
		std::cout << m + std::count(p.begin(), p.end(), 0) << std::endl;
	}
	return 0;
}
