prime = {}
not_prime = {}

(2..1000000).each do |i|
  if not_prime[i] then
    next
  end
  prime[i] = true
  j=i+i
  while j < 1000000
    not_prime[j] = true
    j+=i
  end
end

while n = STDIN.gets
  n = n.chomp.to_i
  count=0
  (2..n).each do |i|
    if prime[i] then
      count += 1
    end
  end
  puts count
end