object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val cache = new scala.collection.mutable.HashMap[Int, Boolean]()

    def isPrime(i: Int): Boolean = {
      cache.get(i) match {
        case Some(result) => result
        case None =>
          val result = !(2 until i).exists(i % _ == 0)
          cache += i -> result
          result
      }
    }

    def infinitePrimes(begin: Int): Stream[Int]= {
      val next = Range(begin + 1, Int.MaxValue).find(isPrime).get
      Stream.cons(begin, infinitePrimes(next))
    }

    while(sc.hasNextInt) {
      val input = sc.nextInt
      println(infinitePrimes(2).takeWhile(input.>).toList.length)
    }
  }
}