L=int(input()) M=int(input()) N=int(input()) thousand=0 NtoM=N//25 N-=NtoM*25 M+=NtoM MtoL=M//4 M-=MtoL*4 L+=MtoL Lto1000=L//10 L-=Lto1000*10 thousand+=Lto1000 print(L+M+N)