#include <iostream>

using namespace std;

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

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

	for( int i = 0;i <= 999999;i++ ){
		if( flag[i] ) {
			p = i + i + 2;
			for( int k = i + p; k <= 999999;k += p ) flag[k] = false;
		}
	}

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