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





ans = 0



for i in range(n+1):

    n10000 = int(i/10000)

    n1000 =int(i/1000)-n10000*10

    n100 =int(i/100)-n1000*10-n10000*100

    n10 = int(i/10)-n100*10-n1000*100-n10000*1000

    n1 = int(i)-n10*10-n100*100-n1000*1000-n10000*10000

    s = n10000+n1000+n100+n10+n1

    if a<= s <= b:

        ans += i

print(ans)        
def findSumofDigits(n):

    s = 0

    while(n > 0):

        s += n % 10

        n = int(n/10)

    return s



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

total = 0

for i in range(n+1):

    s = findSumofDigits(i)

    if a<= s <=b:

        total += i

print(total)
n, a, b = list(map(int, input().split()))
ans = 0
for i in range(n + 1):
    n10000 = int(i / 10000)
    n1000 = int(i / 1000) - n10000 * 10
    n100 = int(i / 100) - n1000 * 10 - n10000 * 100
    n10 = int(i / 10) - n100 * 10 - n1000 * 100 - n10000 * 1000
    n1 = int(i) - n10 * 10 - n100 * 100 - n1000 * 1000 - n10000 * 10000
    s = n10000 + n1000 + n100 + n10 + n1
    if a <= s <= b:
        ans += i
print(ans)

def findSumofDigits(n):
    s = 0
    while n > 0:
        s += n % 10
        n = int(n / 10)
    return s


n, a, b = list(map(int, input().split()))
total = 0
for i in range(n + 1):
    s = findSumofDigits(i)
    if a <= s <= b:
        total += i
print(total)

+def findSumofDigits(n): +    s = 0 +    while n > 0: +        s += n % 10 +        n = int(n / 10) +    return s + + -ans = 0 +total = 0 -    n10000 = int(i / 10000) -    n1000 = int(i / 1000) - n10000 * 10 -    n100 = int(i / 100) - n1000 * 10 - n10000 * 100 -    n10 = int(i / 10) - n100 * 10 - n1000 * 100 - n10000 * 1000 -    n1 = int(i) - n10 * 10 - n100 * 100 - n1000 * 1000 - n10000 * 10000 -    s = n10000 + n1000 + n100 + n10 + n1 +    s = findSumofDigits(i) -        ans += i -print(ans) +        total += i +print(total)