N, A, B = list(map(int, input().split()))



ans = 0



for n in range(N+1):

    if A <= sum(int(c) for c in str(n)) <= B:

        ans += n



print(ans)

N, A, B = list(map(int, input().split()))



ans = 0



print((sum(n for n in range(N+1) if A <= sum(int(c) for c in str(n)) <= B)))

N, A, B = list(map(int, input().split()))
ans = 0
for n in range(N + 1):
    if A <= sum(int(c) for c in str(n)) <= B:
        ans += n
print(ans)

N, A, B = list(map(int, input().split()))
ans = 0
print((sum(n for n in range(N + 1) if A <= sum(int(c) for c in str(n)) <= B)))

-for n in range(N + 1): -    if A <= sum(int(c) for c in str(n)) <= B: -        ans += n -print(ans) +print((sum(n for n in range(N + 1) if A <= sum(int(c) for c in str(n)) <= B)))