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

sum = 0

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

  digit_sum = 0

  num_temp = num

  while num_temp > 0:

    digit_sum += num_temp%10

    num_temp = int(num_temp/10)

  if (A <= digit_sum) and (digit_sum <= B):

    sum += num

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

def find_sum_of_digit(n):

    sum = 0

    while True:

        sum += n%10

        n = int(n/10)

        if n == 0:

            break

    return sum

ans = 0

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

    a = find_sum_of_digit(i)

    if a>=A and a<=B:

        ans += i

print(ans)
N, A, B = list(map(int, input().split()))
sum = 0
for num in range(1, N + 1):
    digit_sum = 0
    num_temp = num
    while num_temp > 0:
        digit_sum += num_temp % 10
        num_temp = int(num_temp / 10)
    if (A <= digit_sum) and (digit_sum <= B):
        sum += num
print(sum)

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


def find_sum_of_digit(n):
    sum = 0
    while True:
        sum += n % 10
        n = int(n / 10)
        if n == 0:
            break
    return sum


ans = 0
for i in range(1, N + 1):
    a = find_sum_of_digit(i)
    if a >= A and a <= B:
        ans += i
print(ans)

-sum = 0 -for num in range(1, N + 1): -    digit_sum = 0 -    num_temp = num -    while num_temp > 0: -        digit_sum += num_temp % 10 -        num_temp = int(num_temp / 10) -    if (A <= digit_sum) and (digit_sum <= B): -        sum += num -print(sum) + + +def find_sum_of_digit(n): +    sum = 0 +    while True: +        sum += n % 10 +        n = int(n / 10) +        if n == 0: +            break +    return sum + + +ans = 0 +for i in range(1, N + 1): +    a = find_sum_of_digit(i) +    if a >= A and a <= B: +        ans += i +print(ans)