max=99999
max_root=Math.sqrt(max).to_i

max_ary=(2..max).to_a
max_ary.delete_if{|num| num%2==0}

pri_ary =[2]
j=0

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

while n=gets
	n=n.to_i

puts pri_ary.concat(max_ary).select{|item| item <= n}.size

end