import scala.io.StdIn

object Main{
  def from(n: Int): Stream[Int] =
    Stream.cons(n,  from(n + 1))

  def sieve(xs: Stream[Int]): Stream[Int] =
    Stream.cons(xs.head,  sieve(xs.tail.filter(_ % xs.head != 0)))

  def primes = sieve(from(2))

  def main(args: Array[String]) {
    Iterator.continually(StdIn.readLine()).takeWhile(_ != null).foreach {
      in =>
        val n = in.toInt
        println(primes.takeWhile(n >= _).length)
    }
  }
}