STDIN.read.split("\n").map { |i| i.chomp.to_i }.each do |max|
  res = (5..max).select(&:odd?).each_with_object([2,3]) do |e, a|
    limit = Math.sqrt(e).round
    lst = a.take_while { |i| i < limit }
    unless lst.any? { |i| e % i == 0 }
      a + [e]
    end
  end
  puts res.count
end