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

    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
      }
    }

    while(sc.hasNextInt) {
      println((2 to sc.nextInt).count(isPrime))
    }
  }
}