#include<iostream>
#include<vector>
using namespace std;

const int MAX_VALUE = 1000000;

class PrimeNumbers
{
public:
	vector<bool> primeNumbers;

	PrimeNumbers()
	{
		this->createPrimeNumbers();
	}
	
	int answer(int N)
	{
		int result = 0;
		for (int i = 0; i <= N; i++)
		{
			if (this->primeNumbers[i])
			{
				result++;
			}
		}
		return result;
	}

	void createPrimeNumbers()
	{
		
		this->primeNumbers = vector<bool>(MAX_VALUE, true);
		this->primeNumbers[0] = false;
		this->primeNumbers[1] = false;
		for (long long i = 2; i < MAX_VALUE; i++)
		{
			for (long long j = i * i; j < MAX_VALUE; j += i)
			{
				this->primeNumbers[j] = false;
			}
			
		}
	}

};

int main()
{
	int N;
	PrimeNumbers pn = PrimeNumbers();
	
	while(cin >> N)
	{
		cout << pn.answer(N) << endl;
	}
	return 0;
}