nums = [] nums[0] = int(input()) nums[1] = int(input()) nums[2] = int(input()) money = nums[0]*100 + nums[1]*25 + nums[2] cnt = 0 thous = money // 1000 if thous!= 0: #cnt += thous money -= 1000*thous hands = money // 100 if hands!= 0: cnt += hands money -= 100*hands twef = money // 25 if twef != 0: cnt += twef money -= 25*twef cnt += money print(cnt)