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



res = 0



for n in range(N + 1):

    sum_digit = 0

    i = n

    while i:

        i, reminder = divmod(i, 10)

        sum_digit += reminder

    if A <= sum_digit <= B:

        res += n

print(res)

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



ans = 0

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

    k = i

    p = 0

    while k > 0:

        p += k % 10

        k //= 10

    if A <= p <= B:

        ans += i



print(ans)

N, A, B = list(map(int, input().split()))
res = 0
for n in range(N + 1):
    sum_digit = 0
    i = n
    while i:
        i, reminder = divmod(i, 10)
        sum_digit += reminder
    if A <= sum_digit <= B:
        res += n
print(res)

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

-res = 0 -for n in range(N + 1): -    sum_digit = 0 -    i = n -    while i: -        i, reminder = divmod(i, 10) -        sum_digit += reminder -    if A <= sum_digit <= B: -        res += n -print(res) +ans = 0 +for i in range(1, N + 1): +    k = i +    p = 0 +    while k > 0: +        p += k % 10 +        k //= 10 +    if A <= p <= B: +        ans += i +print(ans)