import scala.math._
import scala.io.Source.stdin

object Main {
  def eratosthenes(n: Int): List[Int] = {
    def loop(l: List[Int], primeNumList: List[Int] = Nil): List[Int] = {
      if (l.head <= sqrt(n)) {
        val primeNum = l.head
        loop(l.filterNot(_ % primeNum == 0), primeNum +: primeNumList)
      } else l ++: primeNumList
    }

    loop((2 to n).toList)
  }

  def main(args: Array[String]): Unit = {
    val input = stdin.getLines.map(_.toInt).toList
    val primeNumList99 = eratosthenes(input.max)
    input.foreach(i => println(primeNumList99.count(_ <= i)))
  }
}