import java.util.Scanner

fun main(args: Array<String>){
	val sc = Scanner(System.`in`)
	val N = Integer.parseInt(sc.nextLine())

	val ans = when{
		N < 105 -> 0
		N < 135 -> 1
		N < 165 -> 2
		N < 189 -> 3
		N < 195 -> 4
		else    -> 5
	}

	println(ans)
}