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