MAX = 1000
prime = Array.new(1000001,false)
prime[0],prime[1] = true,true
(2..MAX).each do |i|
	j = i * i
	while j < MAX do
		prime[j] = true
		j += i
	end
end

while gets
	n = $_.to_i
	ans = 0
	n.times do |i|
		ans += 1 unless prime[i]
	end
	puts ans
end