k = list(map(int,input().splitlines())) sum=k[0]*100+k[1]*25+k[2] p=sum%1000 q=p%100 r=p//100 s=q%25 u=q//25 print(r+s+u)