#include <iostream>
using namespace std;

const int MAXN = 1000000;

int noprime[MAXN];
bool isprime[MAXN];

void sieve()
{
	int p = 0;
	for (int i = 0; i < MAXN; i++)
		isprime[i] = true;
	isprime[0] = isprime[1] = false;
	for (int i = 2; i < MAXN; i++)
	{
		if (isprime[i])
		{
			p++;
			for (int j = 2 * i; j <= MAXN; j += i)
				isprime[j] = false;
		}
		noprime[i] = p;
	}
}

int main()
{
	sieve();
	int n;
	while (cin >> n)
		cout << noprime[n] << endl;
	return 0;
}
