while n = gets.to_i do
  prime = 0
  if n > 1 then
    prime = 1
  end
  i = 2
  while i <= n do
    j = 2
    limit = Math.sqrt(i).to_i
    begin
      if i%j == 0 then
        break
      end
      j += 1
      if j > limit then
        prime += 1
        break
      end
    end while j <= limit
    i += 1
  end
  puts prime
end