L = int(input()) M = int(input()) N = int(input()) count = N % 25 M += int(N / 25) count += M % 4 L += int(M / 4) count += L % 10 count += int(L/10) print(count)