c100,c25,c1=$stdin.readlines sum = c100*100+c25*25+c1*1 b1000 = sum/1000 sum -= b1000*1000 c100 = sum/100 sum -= c100*100 c25 = sum/25 sum -= c25*25 c1 = sum puts c100+c25+c1