require "prime"

#main
arr = Array.new
while n = gets
   arr << n.to_i
end
arr.each do |i|
   count = 0
   0.upto(i) do |j|
      if Prime.prime?(j)
         count += 1
      end
   end
   puts count
end