#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define digit(N) cout << fixed << setprecision((N))

vector<int> eratosthenes(int N)
{
	vector<int> res;
	vector<bool> prime(N + 1, 1);
	prime[0] = prime[1] = false;
	for (int i = 2; i * i <= N; ++i)
	{
		if (prime[i] == true)
		{
			for (int j = 2 * i; j <= N; j += i)
			{
				prime[j] = false;
			}
		}
	}
	for (int i = 0; i <= N; ++i)
	{
		if (prime[i] == true)
			res.push_back(i);
	}
	return res;
}

int main()
{
	auto prime = eratosthenes(1000001);

	int N;
	while (cin >> N)
	{
		int index = 0;
		while (index < prime.size() && prime[index] <= N)
			index++;
		cout << index << endl;
	}
}
