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



result = 0



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

    num = list(str(i))

    num_sum = 0

    for j in num:

        num_sum += int(j)

    if A <= num_sum <= B:

        result += i



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



# 各桁を合計する関数

def sum_digits(num):

    sum = 0

    while num > 0:

        sum += num % 10

        num = num // 10

    return sum



result = 0



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

    if A <= sum_digits(i) <= B:

        result += i



print(result)
N, A, B = list(map(int, input().split()))
result = 0
for i in range(1, N + 1):
    num = list(str(i))
    num_sum = 0
    for j in num:
        num_sum += int(j)
    if A <= num_sum <= B:
        result += i
print(result)

N, A, B = list(map(int, input().split()))
# 各桁を合計する関数
def sum_digits(num):
    sum = 0
    while num > 0:
        sum += num % 10
        num = num // 10
    return sum


result = 0
for i in range(1, N + 1):
    if A <= sum_digits(i) <= B:
        result += i
print(result)

+# 各桁を合計する関数 +def sum_digits(num): +    sum = 0 +    while num > 0: +        sum += num % 10 +        num = num // 10 +    return sum + + -    num = list(str(i)) -    num_sum = 0 -    for j in num: -        num_sum += int(j) -    if A <= num_sum <= B: +    if A <= sum_digits(i) <= B: