#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>

int main() {
	std::string line;
	while( std::getline( std::cin, line ) ) {
		int const num = std::atoi( line.c_str() );
		int result = num > 1 ? 1 : 0;	// 2
		
		for( int i=3; i<=num; i+=2 ) {
			if ( [&i]() -> bool
			{
				for( int j=3; j<=std::sqrt(i); j+=2 )
					if ( i % j == 0 )
						return false;
				return true;
			}() )
				++result;
		}
		std::cout << result << std::endl;
	}
}