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