L=int(input()) M=int(input()) N=int(input()) a=N//25 b=N%25 c=(a+M)//4 d=(a+M)%4 e=(c+L)//10 f=(c+L)%10 print(b+d+f)