L = int(input())
M = int(input())
N = int(input())

money = L*100+M*25+N
satsu = money//1000
hand = (money - satsu*1000)//100
half = (money - satsu*1000 - hand*100)//25
one = money - satsu*1000 - hand*100 - half*25
print(hand+half+one)