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