L, M, N = int(input()), int(input()), int(input()) coin1 = N % 25 M += N // 25 coin25 = M % 4 L += M // 4 coin100 = L % 10 print(sum([coin1, coin25, coin100]))