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

s = [0]*5

ans = 0

for i in range(n+1):

    s[0] = i // 10000

    s[1] = (i % 10000) // 1000

    s[2] = (i % 1000) // 100

    s[3] = (i % 100) // 10

    s[4] = (i % 10) // 1

    temp = s[0]*10000+s[1]*1000+s[2]*100+s[3]*10+s[4]



    if a <= sum(s) and sum(s) <= b:

        ans += temp

print(ans)
def sum_digits(n):

    sum = 0

    while n > 0:

        sum += n % 10

        n = n // 10

    return sum





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

s = [0]*5

ans = 0

for i in range(n+1):

    temp = sum_digits(i)

    if a <= temp and temp <= b:

        ans += i

print(ans)
n, a, b = list(map(int, input().split()))
s = [0] * 5
ans = 0
for i in range(n + 1):
    s[0] = i // 10000
    s[1] = (i % 10000) // 1000
    s[2] = (i % 1000) // 100
    s[3] = (i % 100) // 10
    s[4] = (i % 10) // 1
    temp = s[0] * 10000 + s[1] * 1000 + s[2] * 100 + s[3] * 10 + s[4]
    if a <= sum(s) and sum(s) <= b:
        ans += temp
print(ans)

def sum_digits(n):
    sum = 0
    while n > 0:
        sum += n % 10
        n = n // 10
    return sum


n, a, b = list(map(int, input().split()))
s = [0] * 5
ans = 0
for i in range(n + 1):
    temp = sum_digits(i)
    if a <= temp and temp <= b:
        ans += i
print(ans)

+def sum_digits(n): +    sum = 0 +    while n > 0: +        sum += n % 10 +        n = n // 10 +    return sum + + -    s[0] = i // 10000 -    s[1] = (i % 10000) // 1000 -    s[2] = (i % 1000) // 100 -    s[3] = (i % 100) // 10 -    s[4] = (i % 10) // 1 -    temp = s[0] * 10000 + s[1] * 1000 + s[2] * 100 + s[3] * 10 + s[4] -    if a <= sum(s) and sum(s) <= b: -        ans += temp +    temp = sum_digits(i) +    if a <= temp and temp <= b: +        ans += i