import scala.annotation.tailrec

object Main {
  val MaxNumber = 99999

  def main(args: Array[String]): Unit = {
    @tailrec
    def _eratos(_numbers: List[Int], _primes: List[Int]): List[Int] = {
      _numbers match {
        case Nil => _primes.reverse ::: _numbers
        case head :: tail =>
          if (head < Math.sqrt(MaxNumber)) {
            _eratos(tail.filter(_ % head != 0), head :: _primes)
          } else {
            _primes.reverse ::: _numbers
          }
      }
    }

    val numbers = Range(2, MaxNumber).toList
    val primes = _eratos(numbers, List[Int]())

    val sc = new java.util.Scanner(System.in)
    while(sc.hasNextInt) {
      val input = sc.nextInt
      println(primes.count(input.>=))
    }
  }
}