import scala.math._
import scala.io.Source.stdin

object Main {
  def eratosthenes(n: Int): Set[Int] = {
    def loop(l: Set[Int]): Set[Int] = if (l.min <= sqrt(n)) loop(l.filterNot(_ % l.min == 0)) else l
    loop((2 to n).toSet)
  }

  def main(args: Array[String]): Unit = {
    val input = stdin.getLines.map(_.toInt).toList
    val primeNumListMax = eratosthenes(input.max)
    input.foreach(i => println(primeNumListMax.count(_ <= i)))
  }
}