import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val count = Array(n + 1) {1}
    (2..n).forEach {
        for (i in it..n step it) {
            count[i]++
        }
    }
    println(count.filterIndexed { index, x -> x == 8 && index % 2 == 1 }.count())
}