# A0J 0009 Prime Number

def prime?(n)
  max = Math.sqrt(n).to_i
  not_prime = (2..max).any? {|x| n % x == 0}
  !not_prime
end

nums = ARGF.each_line.map {|line| line.to_i}
nums.each do |num|
  puts (2..num).to_a.select {|x| prime?(x)}.length
end