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

ans = 0

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

    array = list(map(int,list(str(i))))

    if(sum(array)>=A and sum(array)<=B):

        ans += int(i)

print(ans)

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

ans = 0

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

    sum = 0

    num = i

    while(True):

        sum += num%10

        num = num//10

        if(num == 0):

            if(sum >= A and sum <= B):

                ans += i

                break

            else:

                break

print(ans)

N, A, B = list(map(int, input().split()))
ans = 0
for i in range(int(N) + 1):
    array = list(map(int, list(str(i))))
    if sum(array) >= A and sum(array) <= B:
        ans += int(i)
print(ans)

N, A, B = list(map(int, input().split()))
ans = 0
for i in range(1, int(N) + 1):
    sum = 0
    num = i
    while True:
        sum += num % 10
        num = num // 10
        if num == 0:
            if sum >= A and sum <= B:
                ans += i
                break
            else:
                break
print(ans)

-for i in range(int(N) + 1): -    array = list(map(int, list(str(i)))) -    if sum(array) >= A and sum(array) <= B: -        ans += int(i) +for i in range(1, int(N) + 1): +    sum = 0 +    num = i +    while True: +        sum += num % 10 +        num = num // 10 +        if num == 0: +            if sum >= A and sum <= B: +                ans += i +                break +            else: +                break