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|
  for i in 0..30 do
  temp = 0
  temp = gets.to_i
  counter = 0
  #temp = testCase[j]
  while temp > 0 do
    if Prime.prime?(temp)
      counter += 1
    end
    temp -= 1
  end
  puts counter
end