n, a, b = list(map(int, input().split()))

total_val = 0

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

    i_str = str(i)

    digits = list(i_str)

    sum_digit = sum([int(digit) for digit in digits])

    if sum_digit >= a and sum_digit <= b:

        total_val += i

print(total_val)
n, a, b = list(map(int, input().split()))

canditates = [i for i in range(1, n+1) 

              if a <= sum(list(map(int, list(str(i))))) <= b]

print((sum(canditates)))
n, a, b = list(map(int, input().split()))
total_val = 0
for i in range(1, n + 1):
    i_str = str(i)
    digits = list(i_str)
    sum_digit = sum([int(digit) for digit in digits])
    if sum_digit >= a and sum_digit <= b:
        total_val += i
print(total_val)

n, a, b = list(map(int, input().split()))
canditates = [i for i in range(1, n + 1) if a <= sum(list(map(int, list(str(i))))) <= b]
print((sum(canditates)))

-total_val = 0 -for i in range(1, n + 1): -    i_str = str(i) -    digits = list(i_str) -    sum_digit = sum([int(digit) for digit in digits]) -    if sum_digit >= a and sum_digit <= b: -        total_val += i -print(total_val) +canditates = [i for i in range(1, n + 1) if a <= sum(list(map(int, list(str(i))))) <= b] +print((sum(canditates)))