import scala.math.sqrt
object Main {
    def main(args:Array[String]) = {
        val sc = new java.util.Scanner(System.in)
        while(sc.hasNextInt) {
            val n = sc.nextInt
            var c = 0
            is_prime(n) {
                x => c += 1
            }
            println(c)
        }
    }
    def is_prime(n: Int)(f: => (Int) => Unit) {
        for (i <- 2 to n) {
            if ((2 to sqrt(i).toInt).toList.forall(x => i % x != 0)) {
                f(i)
            }
        }
    }
}