object Main extends App {
  def primes(n: Int): List[Int] = {
    (2 to Math.sqrt(n).toInt).toList.foldLeft((2 to n).toList){(base, p) =>
      base.filterNot(pp => pp > p && pp % p == 0)
    }
  }

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