#include <bits/stdc++.h>
using namespace std;

constexpr int N = 999999;
vector<bool> primes( N+1, true );

void make_table() {
	primes[0] = false;
	primes[1] = false;

	int nr = (int)sqrt( N );
	for( int i = 2; i <= nr; ++i ) {
		if( primes[i] ) {
			for( int j = i+i; j <= N; j += i ) {
				primes[j] = false;
			}
		}
	}
}

int main() {
	ios_base::sync_with_stdio( false );

	make_table();

	int n;
	while( cin >> n ) {
		cout << count( primes.begin()+1, primes.begin()+1 + n, true ) << endl;
	}
}

