import scala.annotation.tailrec
import scala.collection.mutable.ListBuffer

object Main {
  val MaxNumber = 999999
//  val MaxNumber = 100

  def main(args: Array[String]): Unit = {
    @tailrec
    def _eratos(_numbers: ListBuffer[Int], _primes: ListBuffer[Int]): ListBuffer[Int] = {
      _numbers.headOption match {
        case None =>
          _primes ++= _numbers
          _primes
        case Some(head) =>
          _primes += head
          _numbers.foreach { elem =>
            if (elem % head == 0) {
              _numbers -= elem
            }
          }
          _eratos(_numbers, _primes)
      }
    }

    val numbers = ListBuffer[Int]()
    Range(2, MaxNumber).foreach(numbers.+=)
//    println(numbers.toString)

    val primes = _eratos(numbers, ListBuffer[Int]())
//    println(primes.toString)

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