l=int(input()) m=int(input()) n=int(input()) total=l*100+m*25+n*1 ans=0 price=[1000,100,25,1] for i in price: if i!=1000: ans+=(total//i) total%=i print(ans)