L, M, N = [int(input()) for _ in range(3)] M += N // 25 L += M // 4 print(L%10 + M%4 + N%25)