max = 999999
hurui = Array.new(max+1, 0)

hurui[0] = 1
hurui[1] = 1
(max+1-2).times do |i|
  index = i + 2
  if hurui[index] == 0
    (max/index-1).times do |j|
      hurui[index + index*(j+1)] = 1
    end
  end
end

while n = gets do
  n = n.to_i
  count = 0
  for i in 0..n
    count += 1 if hurui[i] == 0
  end
  puts count
end