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



tmp = 0

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

    x = 0

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

        x += int(str(i)[j])

    if x >= a and x <= b:

        tmp += i



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



def calc(x):

    return int(x / 10), x % 10



def func(x, ans):

    a, b = calc(x)

    ans += b

    if a == 0:

        return ans

    return func(a, ans)



ans = 0

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

    if a <= func(i, 0) <= b:

        ans += i



print(ans)
n, a, b = list(map(int, input().split()))
tmp = 0
for i in range(1, n + 1):
    x = 0
    for j in range(len(str(i))):
        x += int(str(i)[j])
    if x >= a and x <= b:
        tmp += i
print(tmp)

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


def calc(x):
    return int(x / 10), x % 10


def func(x, ans):
    a, b = calc(x)
    ans += b
    if a == 0:
        return ans
    return func(a, ans)


ans = 0
for i in range(1, n + 1):
    if a <= func(i, 0) <= b:
        ans += i
print(ans)

-tmp = 0 + + +def calc(x): +    return int(x / 10), x % 10 + + +def func(x, ans): +    a, b = calc(x) +    ans += b +    if a == 0: +        return ans +    return func(a, ans) + + +ans = 0 -    x = 0 -    for j in range(len(str(i))): -        x += int(str(i)[j]) -    if x >= a and x <= b: -        tmp += i -print(tmp) +    if a <= func(i, 0) <= b: +        ans += i +print(ans)