#include <iostream>

using namespace std;

bool is_prime(int x)
{
	if (x == 2) return true;
	if (x % 2 == 0) return false;
	for (int i = 3; i*i <= x; i += 2)
		if (x % i == 0)
			return false;

	return true;
}

int main()
{ 
	int n;

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

		if (n > 1) cnt++;
		for (int i = 3; i <= n; i += 2)
			cnt += is_prime(i);

		cout << cnt << endl;
	}

	return 0;
}