//config = { input: 'tmp', newline: '\r\n' }; // win
config = { input: '/dev/stdin', newline: '\n' }; // linux

p1000 = (function () {
	var ary = [];
	for (var i = 2; i <= 1000; i++) {
		var is_prime = true;
		for (var j in ary) {
			if (i % ary[j] === 0) {
				is_prime = false;
				break;
			}
		}
		if (is_prime) ary.push(i);
	}
	return ary;
}) ();

p1000000 = (function () {
	var ary = [];
	for (var i = 1001; i <= 1000000; i++) {
		var is_prime = true;
		for (var j in p1000) {
			if (i % p1000[j] === 0) {
				is_prime = false;
				break;
			}
		}
		if (is_prime) ary.push(i);
	}
	return ary;
}) ();

prime = p1000.concat(p1000000);

require('fs').readFileSync(config.input, 'ascii')
	.trim()
	.split(config.newline)
	.forEach(function (line) {
		var n = parseInt(line);
		console.log(prime.filter(function (x) { return x <= n; }).length);
	})
	;