object Main {
  def main(args: Array[String]): Unit = {
    val scanner = new java.util.Scanner(System.in)

    val flags = Array.fill(100000001)(true)
    flags(1) = false
    for(i <- 2 to 100000000) {
      if(flags(i)) {
        for(j <- i * 2 to 100000000 by i) flags(j) = false
      }
    }

    var n = 0
    for(_ <- 1 to scanner.nextInt) {
      if(flags(scanner.nextInt)) n = n + 1
    }
    println(n)
  }
}

