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

bool prime[MAX_N];

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

void solve()
{
	int ans, num;
	while (cin >> num)
	{
		ans = 0;
		for (int i = 2; i <= num; i++)
			if (!prime[i])
				ans++;
		cout << ans << endl;
	}
}

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