object Main {
    def main(args: Array[String]) {
        val num = scala.io.StdIn.readInt()

        if(num < 105) {
            println("0")
        }
        else {
            var count = 0
            for(i <- 105 to num if i %2 == 1)
            {
                var check_count = 0
                for(j <- 1 to Math.sqrt(i).toInt) {
                    if(i%j == 0){
                        if(i/j == j) {check_count += 1}
                        else         {check_count += 2}
                    }
                }

                if(check_count == 8) {count += 1}
            }

            println(count)
        }
    }
}