l = int(input()) m = int(input()) n = int(input()) nijuugo = n // 25 n -= nijuugo*25 m += nijuugo hyaku = m // 4 m -= 4*hyaku l += hyaku sen = l // 10 l -= 10*sen print(n+m+l)