/**
  * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0009
  * Prime Number
  */
object Main {
  def main(args: Array[String]): Unit = {
    Iterator.continually(io.StdIn.readLine()).takeWhile(_ != null).map(_.toInt)
      .map((n) => {
        sieveOfEratosthenes.takeWhile(_ <= n).length
      })
      .foreach(println)
  }

  def sieveOfEratosthenes: Stream[Int] = {
    def sieve(stream: Stream[Int]): Stream[Int] = {
      stream.head #:: sieve(stream.tail.filter(_ % stream.head != 0))
    }

    sieve(Stream.from(2))
  }

}