import scala.io.StdIn

object Main extends App {

  def countDivisor(n: Int): Int = (1 to n).count( d => (n % d) == 0 )

  val n = StdIn.readLine.toInt
  val ans = (105 to n by 2).count(i => countDivisor(i) == 8)
  println(ans)
}