primelist = Array.new(1000000,true)
primelist[0] = false
primelist[1] = false
for i in 2..999999 do
 if primelist[i]
  t = 2
  k = i * t
  while k <= 999999
   primelist[k] = false
   t += 1
   k = i * t
  end
 end
end
input = gets
until input.nil?
num = input.to_i
cou = 0
for s in 0..num do
 if primelist[s]
  cou += 1
 end
end
puts cou
input = gets
end
