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