#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

bool isPrime(int x)
{
	bool is_prime = true;
	if (x == 1) is_prime = false;
	for (int i = 2; i <= sqrt(x); i++)
	{
		if (x % i == 0)
		{
			is_prime = false;
			break;
		}
	}
	return is_prime;
}

int countPrime(int x, vector<int> &plist)
{
	int count = 0;
	for (int i = 2; i <= x; i++)
	{
		if (plist[i] == 0) continue;
		if (isPrime(i))
		{
			count++;
		}
		else
		{
			for (int j = i; j < x; j += i)
			{
				plist[j] = 0;
			}
		}
	}
	return count;
}

int main()
{
	int n;
	vector<int> plist(1000000, 1);
	while (cin >> n, !cin.eof())
	{

		cout << countPrime(n, plist) << endl;
	}
	return 0;
}
