l = [int(input()) for i in range(3)] h,t,o = l t = t + (o // 25) o = o % 25 h = h + (t // 4) t = t % 4 h = h % 10 print(h + t + o)