def calc_sum_digits(n):

    return sum(int(x) for x in str(n))



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

print((sum(n if A <= calc_sum_digits(n) <= B else 0 for n in range(1, N+1))))
def calc_sum_digits(n):

    sumdigit = 0

    while n > 0:

        sumdigit += n % 10

        n //= 10

    return sumdigit



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

result = 0

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

    if A <= calc_sum_digits(n) <= B:

        result += n

print(result)
def calc_sum_digits(n):
    return sum(int(x) for x in str(n))


N, A, B = list(map(int, input().split()))
print((sum(n if A <= calc_sum_digits(n) <= B else 0 for n in range(1, N + 1))))

def calc_sum_digits(n):
    sumdigit = 0
    while n > 0:
        sumdigit += n % 10
        n //= 10
    return sumdigit


N, A, B = list(map(int, input().split()))
result = 0
for n in range(1, N + 1):
    if A <= calc_sum_digits(n) <= B:
        result += n
print(result)

-    return sum(int(x) for x in str(n)) +    sumdigit = 0 +    while n > 0: +        sumdigit += n % 10 +        n //= 10 +    return sumdigit -print((sum(n if A <= calc_sum_digits(n) <= B else 0 for n in range(1, N + 1)))) +result = 0 +for n in range(1, N + 1): +    if A <= calc_sum_digits(n) <= B: +        result += n +print(result)