max=999999
max_root=Math.sqrt(max).to_i
max_ary=(2..max).to_a
pri_ary =[]

j=2
while j <= max_root
	pri_ary << j
	max_ary.delete_if{|num| num % j == 0 }
	j=max_ary[0]
end

while n=gets.to_i
	puts (pri_ary + max_ary).select{|item| item <= n}.length
end