L = 100 * int(input()) M = 25 * int(input()) N = int(input()) A = (L + M + N) % 1000 print(A//100 + A%100//25 + A%25)