#include <iostream>
#include <vector>
using namespace std;
#define MAX 1000000
int main( void )
{
	vector <bool> prime( MAX, false );
	prime[2] = true;
	for ( int i = 3; i <= MAX; i++ )
	{
		prime[i] = true;
	}

	for ( int i = 3; i <= MAX; i += 2 )
	{
		if ( prime[i] )
		{
			for ( int j = i + i; j <= MAX; j += i )
			{
				prime[j] = false;
			}
		}
	}

	while ( !cin.eof() )
	{
		int n;
		cin >> n;
		if ( cin.eof() )
			break;

		int cnt = 1;
		for ( int i = 3; i <= n; i += 2 )
		{
			if ( prime[i] )
			{
				cnt++;
			}
		}

		cout << cnt << endl;

	}

	return 0;
}