L,M,N=map(int,[input() for _ in range(3)]) T=L*100+M*25+N print(T%1000//100+T%100//25+T%25)