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

ans = 0

for i in range(N+1):

    lis = [int(i) for i in str(i)]

    if A <= sum(lis) <= B:

        num = ""

        for j in lis:

            num += str(j)

        ans += int(num)

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

ans = 0

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

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

        ans += i

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

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

-for i in range(N + 1): -    lis = [int(i) for i in str(i)] -    if A <= sum(lis) <= B: -        num = "" -        for j in lis: -            num += str(j) -        ans += int(num) +for i in range(1, N + 1): +    if A <= sum([int(x) for x in str(i)]) <= B: +        ans += i