function isPrime(num) {
    if (num == 2 || num == 3) return true;
    if (num < 2 || num % 2 == 0 || num % 3 == 0) return false;
    var limit = Math.floor(Math.sqrt(num));

    var i = 1;
    while(i * 6 - 1 <= limit) {
        if (num % (i * 6 - 1) == 0 || num % (i * 6 + 1) == 0) return false;
        i++;
    }
    return true;
}


var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = input.split('\n');
for (var i = 0; i < lines.length; i++) {
	var cnt = 0;
	var n = +lines[i] - 0;
	for (var j = 2; j <= n; j++) {
		if (isPrime(j)) cnt++;
	}
	console.log(cnt);
}