object Main extends App {
  val src = io.Source.stdin.getLines.map(_.toInt)

  def isPrime(n: Int): Boolean = n>1 && (2 to (math.sqrt(n).toInt)).forall(n%_ != 0)

  def numOfPrimes(n: Int): Int = {
    val li = List.range(2, n+1)
    li.filter(isPrime(_)).length
  }

  for (i <- src) println(numOfPrimes(i))
}