L,M,N = int(input()),int(input()),int(input()) q1,mod1 = divmod(N,25) M += q1 q2,mod2 = divmod(M,4) L += q2 q3,mod3 = divmod(L,10) total = mod3 + mod2 + mod1 print(total)