while n = STDIN.gets
  n = n.chomp.to_i
  not_prime={}
  count_prime=0
  (2..n).each do |i|
    if not_prime.has_key?(i) then
      next
    end
    count_prime+=1
    j=i+i
    while j <= n
      not_prime[j]=1
      j+=i
    end
  end  
  puts count_prime
end