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
            println(primes(n))
        }
    }
    def primes(n: Int): Int = {
        var count = 0
        for (i <- 2 to n) {
            if ((2 to sqrt(i).toInt).toList.forall(x => i % x != 0)) {
                count += 1
            }
        }
        count
    }