a = int(input()) b = int(input()) c = int(input()) def calc(a, b, c): q1, mod1 = divmod(a, 25) b += q1 q2, mod2 = divmod(b, 4) c += q2 q3, mod3 = divmod(c, 10) return mod1 + mod2 + mod3 print(calc(a, b, c))