require 'prime'
while n = gets
  n = n.to_i
  not_prime = [1]
  nums = (1..n).to_a
  count = 1
  p = 2
  while p**2 <= n
    unless not_prime.include?(nums[count])
      p = nums[count]
      for i in p+1..n do
        not_prime << i if i % p == 0
      end
    end
    count += 1
  end

  p nums.size - not_prime.uniq.size
end