process.stdin.resume();
process.stdin.setEncoding('utf8');
 
process.stdin.on('data', function(input){
    input.trim().split('\n').forEach(function(val){
        var N = parseInt(val);
        if( N === 1 ){
            console.log(0);
        }
        else if(N===2){
            console.log(1);
        }
        else{
            var prime = new Array(N);
            var sq, i, j, found, cnt;
            sq = Math.sqrt(N);
            cnt = 1;
            prime[0] = 2;
            
            for(i=3;i<=N;i+=2){
                found = 1;
                for(j=0;prime[j]<=sq;++j){
                    if( i % prime[j] === 0 ){
                        found = 0;
                        break;
                    }
                }
                if( found ){
                    prime[cnt++] = i;
                }
            }
            console.log(cnt);
        }
    });
});