object Main {
  def is_prime(n: Int): Boolean = {
    if (n == 2)
      return true
    var i = 2
    while (i * i <= n){
      if (n%i == 0){
        return false
      }
      i += 1
    }
    return true
  }
  def main(args:Array[String]) = {
    val primes = for (i <- 2 to 999999 if is_prime(i)) yield i
    val sc = new java.util.Scanner(System.in)
    while (sc.hasNext){
      val n = sc.nextInt
      println(primes.count(i => i <=n))
    }
  }
}