#include <iostream>
#include <vector>

using namespace std;

vector<int> Prime;
void PrimeCalc(int n)
{
	bool IsPrime[1000000];
	for(int i = 0; i < 1000000; ++i)
	{
		IsPrime[i] = true;
	}
	IsPrime[0] = IsPrime[1] = false;
	for(int i = 2; i < 1000000; ++i)
	{
		if(IsPrime[i])
		{
			Prime.push_back(i);
			for(int j = 2 * i; j < 1000000; j += i)
			{
				IsPrime[j] = false;
			}
		}
	}
}

void solve()
{
	int n;
	cin >> n;
	PrimeCalc(n);
	int ans = 0;
	int pos = 0;
	for(int i = 0; i < Prime.size(); ++i)
	{
		if(Prime[i] <= n)
		{
			++ans;
		}
		else
		{
			break;
		}
	}
	cout << ans << endl;
}

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