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

total = 0

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

    i_sum = 0

    for j in range(len(str(i))):

        i_sum += int(str(i)[j])

    # print("i_sum", i_sum)

    if A <= i_sum and i_sum <= B:

        total += i



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

total = 0



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

def sumOfDigits(n):

    sum = 0

    while n > 0:

        sum += n % 10

        n = n // 10

    return sum



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

    j = sumOfDigits(i)

    if A <= j and j <= B:

        total += i



print(total)
N, A, B = list(map(int, input().split()))
total = 0
for i in range(1, N + 1, 1):
    i_sum = 0
    for j in range(len(str(i))):
        i_sum += int(str(i)[j])
    # print("i_sum", i_sum)
    if A <= i_sum and i_sum <= B:
        total += i
print(total)

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


for i in range(1, N + 1, 1):
    j = sumOfDigits(i)
    if A <= j and j <= B:
        total += i
print(total)

+# 各桁の和を計算する関数 +def sumOfDigits(n): +    sum = 0 +    while n > 0: +        sum += n % 10 +        n = n // 10 +    return sum + + -    i_sum = 0 -    for j in range(len(str(i))): -        i_sum += int(str(i)[j]) -    # print("i_sum", i_sum) -    if A <= i_sum and i_sum <= B: +    j = sumOfDigits(i) +    if A <= j and j <= B: