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