prime = Array.new(10**6,1)
(2..1000).each{|i|
	j = i * i
	while j < 10**6
		prime[j] = 0
		j += i
	end
}
ans = Array.new(10**6,0)
(2..10**6).each{|i|
	ans[i] = prime[i].to_i + ans[i-1].to_i
}
while gets
	p ans[$_.to_i]
end