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

money = L * 100 + M * 25 + N * 1

rest = money%1000
N = int(rest/100)
rest = rest%100
N += int(rest/25)
N += rest%25

print(N)