l = gets.chomp!.to_i m = gets.chomp!.to_i n = gets.chomp!.to_i count = 0 if n * 1 % 25 >= 10 count += n else m + (n * 1) / 25 count += (n * 1) % 25 end if (m * 25) % 100 >= 10 count += m else l + (m * 25) / 100 count += (m * 25) % 100 end if (l * 100) % 1000 >= 10 puts count else puts count += (l * 100) % 1000 end