# frozen_string_literal: true in_n = gets.chomp.to_i result = in_n / 500 remaining = in_n % 500 if remaining >= 100 result += 1 end puts result