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



ns = str(n)



numarr = list(range(1, n+1))



keta = [0]





for num in numarr:

    sum1 = 0



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



        sum1 += int(str(num)[i])



    if (a <= sum1 and sum1 <= b):

        keta.append(num)



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



nums = list(range(1,n + 1))



ans = 0



for num in nums:

    sum = 0

    sum += num % 10

    wari = num // 10

    

    while wari > 0:

        sum += wari % 10

        wari = wari // 10

    

    if sum >= a and sum <= b:

        ans += num



print(ans)
n, a, b = list(map(int, input().split()))
ns = str(n)
numarr = list(range(1, n + 1))
keta = [0]
for num in numarr:
    sum1 = 0
    for i in range(len(str(num))):
        sum1 += int(str(num)[i])
    if a <= sum1 and sum1 <= b:
        keta.append(num)
print((sum(keta)))

n, a, b = list(map(int, input().split()))
nums = list(range(1, n + 1))
ans = 0
for num in nums:
    sum = 0
    sum += num % 10
    wari = num // 10
    while wari > 0:
        sum += wari % 10
        wari = wari // 10
    if sum >= a and sum <= b:
        ans += num
print(ans)

-ns = str(n) -numarr = list(range(1, n + 1)) -keta = [0] -for num in numarr: -    sum1 = 0 -    for i in range(len(str(num))): -        sum1 += int(str(num)[i]) -    if a <= sum1 and sum1 <= b: -        keta.append(num) -print((sum(keta))) +nums = list(range(1, n + 1)) +ans = 0 +for num in nums: +    sum = 0 +    sum += num % 10 +    wari = num // 10 +    while wari > 0: +        sum += wari % 10 +        wari = wari // 10 +    if sum >= a and sum <= b: +        ans += num +print(ans)