require 'prime'
testCase = Array.new
i = 0
STDIN.each_line do |line|
  testCase[i] = line.to_i
  i += 1
end
testCase.length.times do |j|
  counter = 0
  temp = testCase[j]
  while temp > 0 do
    if Prime.prime?(temp)
      counter += 1
    end
    temp -= 1
  end
  puts counter
end