def sm(x):

    xls = list(str(x))

    a = 0

    for i in range(len(xls)):

        a += int(xls[i])

    return a



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

ans = 0

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

    if A <= sm(i) <= B:

        ans += i

print(ans)

def sm(x):

    a = 0

    a += (x%10)

    a += (x//10)%10

    a += ((x//10)//10)%10

    a += (((x//10)//10)//10)%10

    a += ((((x//10)//10)//10)//10)%10

    return a



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

ans = 0

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

    if A <= sm(i) <= B:

        ans += i

print(ans)
def sm(x):
    xls = list(str(x))
    a = 0
    for i in range(len(xls)):
        a += int(xls[i])
    return a


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

def sm(x):
    a = 0
    a += x % 10
    a += (x // 10) % 10
    a += ((x // 10) // 10) % 10
    a += (((x // 10) // 10) // 10) % 10
    a += ((((x // 10) // 10) // 10) // 10) % 10
    return a


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

-    xls = list(str(x)) -    for i in range(len(xls)): -        a += int(xls[i]) +    a += x % 10 +    a += (x // 10) % 10 +    a += ((x // 10) // 10) % 10 +    a += (((x // 10) // 10) // 10) % 10 +    a += ((((x // 10) // 10) // 10) // 10) % 10