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