l, m, n = [int(input()) for i in range(3)] if n >= 25: m += n // 25 n %= 25 if m >= 4: l += m // 4 m %= 4 if l >= 10: l %= 10 print(l + m + n)