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

u = 0

for i in range(N+1):

    num = sum(map(int, list(str(i))))

    if num >= A and num <= B:

        u += i

print(u)

def find_sum_of_digits(n):

    sum = 0

    while (n > 0):

        sum += n % 10

        n //= 10

    return sum



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

u = 0

for i in range(N+1):

    # num = sum(map(int, list(str(i))))

    num = find_sum_of_digits(i)

    if num >= A and num <= B:

        u += i

print(u)

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

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


N, A, B = list(map(int, input().split()))
u = 0
for i in range(N + 1):
    # num = sum(map(int, list(str(i))))
    num = find_sum_of_digits(i)
    if num >= A and num <= B:
        u += i
print(u)

+def find_sum_of_digits(n): +    sum = 0 +    while n > 0: +        sum += n % 10 +        n //= 10 +    return sum + + -    num = sum(map(int, list(str(i)))) +    # num = sum(map(int, list(str(i)))) +    num = find_sum_of_digits(i)