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

object Main {

  def prime(x:Int):Boolean = (2 to math.sqrt(x).toInt).filter(x % _ == 0).size == 0

  @tailrec
  def loop(s: String){
    if(s != null){
       val Array(a,_*) = s.split(" ").map(_.toInt)
       println(((math.sqrt(a).toInt-1 max 2) to a).filter(prime).size)
       loop(readLine)
    }
  }

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