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