var input = require("fs").readFileSync("/dev/stdin","utf8");
var array = (input.trim()).split("\n");

for (var aoj = 0; aoj < array.length; aoj++) {
  var maxValue = array[aoj];
  var x = 0;
  var primearray = new Array(maxValue + 1);
  for (var i = 0; i <= maxValue; i++) {
    primearray[i] = 1;
  }

  // ?´???°?????????????´???°?????????????????????0?????£??\
  for (var i = 2; i <= maxValue / 2; i++) {
    for (var j = i * 2 ; j <= maxValue ; j += i) {
      primearray[j] = 0
    }
  }
  primearray[0] = 0
  primearray[1] = 0

  // ??????
  for (var i = 2; i <= maxValue; i++) {
    if (primearray[i] == 1) {
      // console.log(i)
      x++
    }
  }
  console.log(x)
}