#include<iostream>
#define MAX_N 1000000
using namespace std;

static bool prime[MAX_N];
 static int num[MAX_N] = { 0 };

void ini()
{
	for (int i = 2; i < MAX_N; i++)
		prime[i] = true;
	for (int i = 2; i < MAX_N; i++)
	{
		if (!prime[i])
		{
			num[i] = num[i - 1] + prime[i];
			continue;
		}
		else
		{
			for (int j = i * 2; j < MAX_N; j += i)
			{
				if (prime[j] && j%i == 0)
					prime[j] = false;
			}
		}
		num[i] = num[i - 1] + prime[i];
	}
}

void solve()
{
	int n;
	while (cin >> n)
		cout << num[n] << endl;
}

int main()
{
	ini();
	solve();
	return 0;
}