#include <iostream>
#include <cmath>

using namespace std;

int main(int argc, char const* argv[])
{
	bool flag[1000000];
	int p;

	for( int i = 0;i < 1000000;i++ ) flag[i] = true;

	for( int i = 2;i <= sqrt( 1000000 );i++ ){
		if( flag[i] != false ) for( int j = 2;j * i < 1000000;j++ ) flag[j * i] = false;
	}

	while( cin >> p ){
		int count = 0;
		for( int i = 2;i <= p;i++ ) if( flag[i] ) count++;
		cout << count << endl;
	}
}