L=int(input()) M=int(input()) N=int(input()) A=L*100+M*25+N*1 ans=0 A%=1000 ans+=A//100 A%=100 ans+=A//25 A%=25 ans+=A print(ans)