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