a=int(input()) b=int(input()) c=int(input()) d = 100*a+25*b+c e = d//1000 f = d-1000*e g = f//100 h = (f-100*g)//25 i = f-100*g-25*h print(g+h+i)