process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
    main(chunk.trim());
});

function main(chunk){
    var lines = chunk.split("\n");
    for(var i=0;i<lines.length;i++){
        console.log(calc(Number(lines[i])));
    }
}
var arr = [2];
function calc(num){
    if(arr[arr.length-1] > num){
        for(var i=0;i<arr.length;i++){
            if(arr[i]>num){
                return i;
            }
        }
    }
    start:for(var i = arr[arr.length-1]+(arr[arr.length-1]%2==0?1:2); i<=num; i+=2){
       for(var j=0;j<arr.length;j++){
          if(i%arr[j]==0){
             continue start;
          }
          if(arr[j]>=Math.sqrt(i)){
             break;
          }
       }
       arr.push(i);
    }
    return arr.length;
}