object Main{
    def main(args:Array[String]):Unit={
        val in = new java.util.Scanner(System.in)
        try{
            while(in.hasNextLine != null){
                println(judeg.prime_count(in.nextInt))
            }
        }catch{
        case e: NoSuchElementException =>

        }finally{
            in.close()
         }

    }

}

object judeg{

     def prime(n:Int):Boolean={
        @annotation.tailrec
        def loop(n:Int,m:Int):Boolean= {
        if (n <= m) return   true
        else if(n % m ==0) return  false
        else loop(n,m+2)
        }

        if(n%2 == 0) return   false
        loop(n,3)
     }

    def prime_count(n:Int):Int = {
        @annotation.tailrec
        def go(n:Int,l:Int,c:Int):Int = {
            if(l > n) c
            else if( prime(l))  go(n,l+1,c+1)
            else  go(n,l+1,c)
        }
     if (n==1) 0
     else if(n ==2) 1
    else if (n == 3) 2
    else go(n,1,0)
    }

}