l = gets.to_i m = gets.to_i n = gets.to_i total = l*100 + m*25 + n*1 total %= 1000 n100 = total/100 total %= (100*n100) n25 = total/25 total %= (25*n25) n1 = total puts "#{n100+n25+n1}"