L=int(input()) M=int(input()) N=int(input()) if(L//25>=1): L=L%25 M=M+(L//25) elif(M//4>=1): M=M%4 N=N+(M//4) elif(N//10>=1): N=N%10 print(L+M+N)