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