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

number = list(range(A, N+1))

number_str = list(map(str, number))

arc = []

for item in number_str:

    num = list(map(int, item))

    s = sum(num)

    if A <= s and s <= B:

        arc.append(int(item))

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

numbers = list(range(A, N + 1))

somesums = 0

for i in numbers:

    p = i

    sums = 0

    while p >= 1:

        sums += p%10

        p //= 10

    if A <= sums <= B:

        somesums += i

print(somesums)
N, A, B = list(map(int, input().split()))
number = list(range(A, N + 1))
number_str = list(map(str, number))
arc = []
for item in number_str:
    num = list(map(int, item))
    s = sum(num)
    if A <= s and s <= B:
        arc.append(int(item))
print((sum(arc)))

N, A, B = list(map(int, input().split()))
numbers = list(range(A, N + 1))
somesums = 0
for i in numbers:
    p = i
    sums = 0
    while p >= 1:
        sums += p % 10
        p //= 10
    if A <= sums <= B:
        somesums += i
print(somesums)

-number = list(range(A, N + 1)) -number_str = list(map(str, number)) -arc = [] -for item in number_str: -    num = list(map(int, item)) -    s = sum(num) -    if A <= s and s <= B: -        arc.append(int(item)) -print((sum(arc))) +numbers = list(range(A, N + 1)) +somesums = 0 +for i in numbers: +    p = i +    sums = 0 +    while p >= 1: +        sums += p % 10 +        p //= 10 +    if A <= sums <= B: +        somesums += i +print(somesums)