l = (gets || "").chomp.to_i m = (gets || "").chomp.to_i n = (gets || "").chomp.to_i m2 = m + n / 25 result = (l + m2 / 4) % 10 + m2 % 4 + n % 25 puts result