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