require "prime"

def getprimenum x
	counter = 0

	(x + 1).upto(2 * x) {|i|
		next if (i % 2 == 0 && i > 2 || i % 3 == 0 && i > 3 || i % 5 == 0 && i > 5 || i % 7 == 0 && i > 7)

		counter += 1 if Prime.instance.prime?(i)
	}

	return counter
end

loop {

	begin
		l = gets.chomp.to_i

		puts getprimenum(l) if l > 0
	rescue
		break
	end
}