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 eratosthenesSieve(list: List[Int], range: Seq[Int]): List[Int] = {
    val last = list.last
    val range1 = range.filter(i => i % last != 0)

    if (range1.max < math.pow(list.max, 2)) {
      list ::: range1.toList
    } else {
      val list1 = list ::: List(range1.head)
      eratosthenesSieve(list1, range1)
    }
  }

  def toList(max: Int): List[Int] = {
    val range = 2 to max
    val list = List(range.head)
    eratosthenesSieve(list, range)
  }

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

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