class Integer
  def prime?
    return false if self < 2
    return true if self == 2
    return false if (self % 2).zero?

    3.step(Math.sqrt(self), 2) do |n|
      return false if (self % n).zero?
    end
    true
  end
end

while line = gets
  n = line.to_i
  puts (1..n).count(&:prime?)
end