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