L = gets.to_i M = gets.to_i N = gets.to_i price=L*100+M*25+N ans=(price%1000)/100 ans+=(price%100)/25 ans+=(price%25) puts ans