#include <iostream>
#include <vector>

using namespace std;
bool IsPrime[1000000];
vector<int> Prime;

void calc()
{
	for(int i = 0; i < 1000000; ++i)
	{
		IsPrime[i] = true;
	}
	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()
{
	calc();
	int n;
	cin >> n;
	int count = 0;
	int a = Prime.size() - 1;
	while(Prime[count] <= n)
	{
		if(count >= a)
		{
			break;
		}
		count++;
	}
	cout << count << endl;
}

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