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

ans = 0

for i in range(1, N+1):

    if A <= sum([int(_) for _ in list(str(i))]) <=B:

        ans += i



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

keta = [sum([int(i) for i in str(i)]) for i in range(1, N+1)]

ans = 0

for index, i in enumerate(keta):

    if A <= i <= B:

        ans += index+1

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

N, A, B = list(map(int, input().split()))
keta = [sum([int(i) for i in str(i)]) for i in range(1, N + 1)]
ans = 0
for index, i in enumerate(keta):
    if A <= i <= B:
        ans += index + 1
print(ans)

+keta = [sum([int(i) for i in str(i)]) for i in range(1, N + 1)] -for i in range(1, N + 1): -    if A <= sum([int(_) for _ in list(str(i))]) <= B: -        ans += i +for index, i in enumerate(keta): +    if A <= i <= B: +        ans += index + 1