L, M, N = [int(input()) for _ in range(3)] s = (100*L + 25*M + N) % 1000 ans = 0 for c in [100, 25, 1]: ans += s // c s %= c print(ans)