import math L=int(input()) M=int(input()) N=int(input()) total=L*100+M*25+N Bc=math.floor(total/1000) Lc=math.floor((total-Bc*1000)/100) Mc=math.floor((total-Bc*1000-Lc*100)/25) Nc=total-Lc*100-Mc*25-Bc*1000 print(Lc+Mc+Nc)