N,A,B=input().split()



sum=0

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

    nums = list(str(i))

    tmp = 0

    for j in nums:

        tmp = tmp + int(j)

    if int(A)<=tmp:

        if tmp<=int(B):

            sum = sum + i

print(sum)

N,A,B=input().split()

N=int(N)

A=int(A)

B=int(B)



def findSumOfDigits(n):

    k = 0

    sum = 0

    while n>0:

        k = n%10

        n = n//10

        sum = sum + k

    return sum



sum=0

for i in range(N+1):

    tmp = findSumOfDigits(i)

    if A<=tmp:

        if tmp<=B:

            sum = sum + i

print(sum)

N, A, B = input().split()
sum = 0
for i in range(int(N) + 1):
    nums = list(str(i))
    tmp = 0
    for j in nums:
        tmp = tmp + int(j)
    if int(A) <= tmp:
        if tmp <= int(B):
            sum = sum + i
print(sum)

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


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


sum = 0
for i in range(N + 1):
    tmp = findSumOfDigits(i)
    if A <= tmp:
        if tmp <= B:
            sum = sum + i
print(sum)

+N = int(N) +A = int(A) +B = int(B) + + +def findSumOfDigits(n): +    k = 0 +    sum = 0 +    while n > 0: +        k = n % 10 +        n = n // 10 +        sum = sum + k +    return sum + + -for i in range(int(N) + 1): -    nums = list(str(i)) -    tmp = 0 -    for j in nums: -        tmp = tmp + int(j) -    if int(A) <= tmp: -        if tmp <= int(B): +for i in range(N + 1): +    tmp = findSumOfDigits(i) +    if A <= tmp: +        if tmp <= B: