require "prime"
def getprimenum x
	counter = 0

	(x + 1).upto(2 * x) {|i|
		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
}