#include<iostream>

int n;
int p;
int prime[1000000];
bool isprime[1000000];

void sieve()
{
	p = 0;
	isprime[0] = isprime[1] = false;
	for( int i = 2; i <= n; i++ ) isprime[i] = true;
	
	for( int i = 2; i <= n; i++ ){
		if( isprime[i] ){
			isprime[i] = false;
			prime[p++] = i;
			for( int j = i * 2; j <= n; j += i ) isprime[j] = false;
		}
	}

 	return;
}

int main()
{
	while( std::cin >> n ){	
		sieve();
		std::cout << p << std::endl;
	}

 	return 0;
}