import scala.io.StdIn._
import scala.annotation.tailrec
import scala.collection._

object Main {

  //def prime(x:Int,list:List[Int]):Boolean = list.filter(y => x % y == 0 && x>y).size == 0
  def prime(num: Int, factors: List[Int]): Boolean = factors.forall(num % _ != 0)

  def primesUnder(n: Int): List[Int] = {
    require(n >= 2)

    def rec(i: Int, primes: List[Int]): List[Int] = {
      if (i >= n) primes
      else if (prime(i, primes)) rec(i + 1, i :: primes)
      else rec(i + 1, primes)
    }

    rec(2, List()).reverse
  }

  @tailrec
  def loop(s: String){
    if(s != null){
       val Array(n,_*) = s.split(" ").map(_.toInt)
       println(primesUnder(n+1).size)
       loop(readLine)
    }
  }

  def main(args: Array[String]): Unit ={
    loop(readLine)
  }
}