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



ok_nums = []

ok_nums_append = ok_nums.append



for i in range(N+1):

    i_s = str(i)



    if A <= sum(list(map(int, list(i_s)))) <= B:

        ok_nums_append(i)



print((sum(ok_nums)))

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



# 各桁の和を計算する関数

def find_sum_of_digits(n):

    sum_num = 0

    while (n>0):

        sum_num += n % 10

        n = n // 10

    return sum_num



total = 0

for i in range(N+1):

    sum_num = find_sum_of_digits(i)

    if A <= sum_num <= B:

        total += i

print(total)
N, A, B = list(map(int, input().split()))
ok_nums = []
ok_nums_append = ok_nums.append
for i in range(N + 1):
    i_s = str(i)
    if A <= sum(list(map(int, list(i_s)))) <= B:
        ok_nums_append(i)
print((sum(ok_nums)))

N, A, B = list(map(int, input().split()))
# 各桁の和を計算する関数
def find_sum_of_digits(n):
    sum_num = 0
    while n > 0:
        sum_num += n % 10
        n = n // 10
    return sum_num


total = 0
for i in range(N + 1):
    sum_num = find_sum_of_digits(i)
    if A <= sum_num <= B:
        total += i
print(total)

-ok_nums = [] -ok_nums_append = ok_nums.append +# 各桁の和を計算する関数 +def find_sum_of_digits(n): +    sum_num = 0 +    while n > 0: +        sum_num += n % 10 +        n = n // 10 +    return sum_num + + +total = 0 -    i_s = str(i) -    if A <= sum(list(map(int, list(i_s)))) <= B: -        ok_nums_append(i) -print((sum(ok_nums))) +    sum_num = find_sum_of_digits(i) +    if A <= sum_num <= B: +        total += i +print(total)