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