(function(input) {
    var p = input.replace(/\n$/, '').split('\n').map(Number);
    for (var i = 0; i < p.length; i++) {
        var n = p[i];
        console.log(primeNumbersIn(n).length);
    }
})(require('fs').readFileSync('/dev/stdin', 'utf8'));

function primeNumbersIn(x) {
    var a = {};
    for (var i = 2; i <= x; i++) {
        a[i] = 1;
    }

    var n = 2;
    do {
        for (var i = n * 2; i <= x; i += n) {
            if (i in a) {
                delete a[i];
            }
        }
        var m = x;
        for (i in a) {
            i = Number(i);
            if (n < i && i < m) {
                m = i;
            }
        }
        n = m;
    } while (n <= Math.sqrt(x))
    return Object.keys(a).map(Number);
}