def count_prime(num)
  arr = (2..num).to_a
  (2..Math::sqrt(num)).each do |i|
    arr.delete_if { |a| a % i == 0 && a != i }
  end
  return arr.count
end

for i in 1..30 do
  num = gets.to_i
  puts count_prime(num)
end