l = int(input()) m = int(input()) n = int(input()) if n >= 25: m += n//25 n %= 25 if m >= 4: l += m//4 m %= 4 if l >= 10: l %= 10 print(n + m + l)