var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = input.split('\n');
var num, n, val;
num = lines.length;

  var cnt = 0;
  for(n=0;n<num;++n){
    val = lines[n] * 1; // parse to integer
    var prime = new Array(val);
    if( val == 1 ){
      cnt = 0;
    }
    if( val == 2 ){
      cnt = 1;
    }
    else{
      var sq, i, j, found;
      sq = Math.sqrt(val);
      cnt = 1;
      found = 1;
      prime[0] = 2;
      for(i=3;i<sq;++i){
        for(j=0;prime[j]<=sq;++j){
          if( i % prime[j] == 0 ){
            found = 0;
            break;
          }
        }
        if( found ){
          prime[cnt++] = i;
        }
      }
    }

    print(cnt + "\n");
  }