#include"iostream"

using namespace std;
int sum;
int prime(int n) {
	if (n > 2 && !(n & 1) || n < 2)
		return 0;
	for (int i = 3; i*i <= n; i += 2)
		if (!(n%i))
			return 0;
	sum++;
	return 0;
}

int main()
{
	int n,t=1;
	int *p;
	while (cin >> n)
	{
		sum = 0;
		p = new int[n];
		for (int i = 1; i <= n; i++)
			p[i] = prime(i);
		cout << sum << endl;
		t++;
		if (t > 30)
			break;
	}
	return 0;
}