l = gets.not_nil!.to_i64 m = gets.not_nil!.to_i64 n = gets.not_nil!.to_i64 m += n // 25 n = n % 25 l += m // 4 m = m % 4 l = l % 10 puts l + m + n