l = int(input())
m = int(input())
n = int(input())
total = 0
m += (n//25)
l += (m//4)
total+=( (n%25) + (m%4) + (l%10) )
print(total)