import math L=int(input()) M=int(input()) N=int(input()) Z = 0 if N>=25: T=math.floor(N/25) M=M+T N=N-25*T if M>=4: T=math.floor(M/4) L=L+T M=M-4*T if L>=10: T=math.floor(L/10) Z=Z+T L=L-10*T print(L+M+N)