a,b,c = map(int, input().split()) qc, amod = divmod(c, 25) t = b + qc qb, bmod = divmod(t, 4) m = a + qb qc, cmod = divmod(m, 10) print(amod + bmod + cmod)