import java.util.Scanner

import scala.collection.mutable
import scala.collection.mutable.ListBuffer

object Main {

  def main(args: Array[String]) = {

    val scanner = new Scanner(System.in)

    val inputs = ListBuffer.empty[Int]
    while(scanner.hasNextLine) {
      inputs += scanner.nextLine().toInt
    }

    inputs.foreach { N =>
      val primes = mutable.BitSet()

      primes(2) = true

      for (i <- 3 to N by 2) {
        primes(i) = true
      }

      for (i <- 3 to Math.sqrt(N).toInt by 2 if primes(i); j <- i * 2 to N by i) {
        primes(j) = false
      }

      println(primes.count(p => primes(p)))
    }
  }
}