function Main(input){
    var N;
    var lines = input.split("\n");
    lines.push("EOF");
    
    for(var n=0;lines[n]!="EOF";++n){
        N = Int(lines[n]);
        if( N === 1 ){
            console.log(0);
        }
        else if(N===2){
            console.log(1);
        }
        else{
            var prime = new Array(N);
            var sq, i, j, base, found, cnt;
            sq = Math.sqrt(N);
            cnt = 1;
            prime[0] = 2;
            
            for(i=3;i<=N;++i){
                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);
    }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));