import scala.util.control.Breaks
object Main extends App {
  val maxn = 1000000
  val sqrtmaxn = 1000
  val isprime = Array.fill(maxn)(true)
  isprime(0) = false
  isprime(1) = false

  for (i <- 2 to sqrtmaxn) {
    if (isprime(i)){
      for (j <- 2*i until maxn by i) isprime(j) = false
    }
  }

  val bs = Breaks

  bs.breakable {
    for (line <- io.Source.stdin.getLines()) {
      if (line.isEmpty) bs.break()

      println((0 to line.toInt).count(isprime(_)))
    }
  }
}
