l = int(input())
m = int(input())
n = int(input())

m += n // 25
n -= n // 25 * 25

l += m // 4
m -= m // 4 * 4

l -= l // 10 * 10

print(l+m+n)