m=int(input())*100+int(input())*25+int(input()) m%=1000 ans=m//100 m%=100 ans+=m//25+m%25 print(ans)