object Main extends App {
  def primes(n: Int): IndexedSeq[Int] = {
    (2 to Math.sqrt(n).toInt).toIndexedSeq.foldLeft((2 to n).toIndexedSeq){(base, p) => {
      base.filter(_ <= p) ++ base.filter(_ > p).filterNot(pp => pp % p == 0)
    }}
  }

  val inputs = Iterator.continually(readLine()).takeWhile(_ != null).toVector.map(_.toInt)
  val maxPrimes = primes(inputs.max)
  println(inputs.map{n =>
    maxPrimes.count(_ <= n)
  }.mkString("\n"))
}