L=int(input()) M=int(input()) N=int(input()) s=0 while N>=25: N=N-25 M=M+1 while M>=4: M=M-4 L=L+1 while L>=10: L=L-10 s=s+1 print(L+M+N)