# def prime? x
	
# end


require "prime"
def getprimenum x
	counter = 0

	(x + 1).upto(2 * x) {|i|
		counter += 1 if Prime.instance.prime?(i)
	}

	return counter
end

loop {
	# puts getprimenum(gets.chomp.to_i)
	# l = gets.chomp.to_i
	l = ""

	# if l == nil
		# break
	# end

	begin
		l = gets.chomp.to_i
	rescue
		break
	end


	puts getprimenum(l)
}