i=input t=eval(f"({i()}00+25*{i()}+{i()})%1000") print(t//100+t%100//25+t%25)