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

  val lines = Iterator.continually(readLine()).takeWhile(_ != null)
  println(lines.map(_.toLong).map{n =>
    primeList(n).size
  }.mkString("\n"))
}