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

  @tailrec
  def loop(s: String){
    if(s != null){
       val Array(n,_*) = s.split(" ").map(_.toInt)
       val list = List(2,3,5,7,11) ::: (13 to math.sqrt(n).toInt).toList.filter(x => x%2!=0 && x%3!=0 && x%5!=0 && x%7!=0 && x%11!=0)
       println((2 to n).toList.filter(prime(_,list)).size)
       loop(readLine)
    }
  }

/*
  @tailrec
  def loop(s: String){
    if(s != null){
        val Array(n,_*) = s.split(" ").map(_.toInt)
        val sq = math.sqrt(n).toInt
        var prime = mutable.Seq.fill(n+1)(1)
        prime(0)=0
        prime(1)=0
        for{
          i <- 2 to sq
          if prime(i) == 1
          j <- i*2 to n
          if j%i == 0
        } prime(j) = 0

        println(prime.sum)
        loop(readLine)
    }
  }
*/
  def main(args: Array[String]): Unit ={
    loop(readLine)
  }
}