N, A, B = [int(x) for x in input().split()]



ans = 0

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

    nl = list(map(int, list(str(n))))

    s = 0

    for i in nl:

        s += i

    if s >= A and s <= B:

        ans += n

print(ans)

N, A, B = [int(x) for x in input().split()]



def sumEachOrder(n):

    s = 0

    while n > 0:

        a = n % 10

        s += a

        n //= 10

    return s



ans=0

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

    s = sumEachOrder(n)

    if s >= A and s <= B:

        ans += n

print(ans)

N, A, B = [int(x) for x in input().split()]
ans = 0
for n in range(1, N + 1):
    nl = list(map(int, list(str(n))))
    s = 0
    for i in nl:
        s += i
    if s >= A and s <= B:
        ans += n
print(ans)

N, A, B = [int(x) for x in input().split()]


def sumEachOrder(n):
    s = 0
    while n > 0:
        a = n % 10
        s += a
        n //= 10
    return s


ans = 0
for n in range(1, N + 1):
    s = sumEachOrder(n)
    if s >= A and s <= B:
        ans += n
print(ans)

+ + +def sumEachOrder(n): +    s = 0 +    while n > 0: +        a = n % 10 +        s += a +        n //= 10 +    return s + + -    nl = list(map(int, list(str(n)))) -    s = 0 -    for i in nl: -        s += i +    s = sumEachOrder(n)