print((function (l, m, n) if n >= 25 then m, n = m+math.floor(n/25), n%25 end if m >= 4 then l, m = l+math.floor(m/4), m%4 end if l >= 10 then l = l%10 end return l+m+n end)(io.stdin:read("*n"),io.stdin:read("*n"),io.stdin:read("*n")))