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



res = 0

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

    tmp = 0

    for j in str(i):

        tmp += int(j)

    if tmp >= A and tmp <= B:

        res += i

print(res)

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





def f(x):

    res = 0

    while x > 0:

        res += x % 10

        x //= 10

    return res





res = 0

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

    x = f(i)

    if A <= x and x <= B:

        res += i

print(res)

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

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


def f(x):
    res = 0
    while x > 0:
        res += x % 10
        x //= 10
    return res


res = 0
for i in range(1, N + 1):
    x = f(i)
    if A <= x and x <= B:
        res += i
print(res)

+ + +def f(x): +    res = 0 +    while x > 0: +        res += x % 10 +        x //= 10 +    return res + + -    tmp = 0 -    for j in str(i): -        tmp += int(j) -    if tmp >= A and tmp <= B: +    x = f(i) +    if A <= x and x <= B: