n, a, b = list(map(int, input().split()))

count = 0



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

  x = str(xx)

  sum_x = 0

  for i in range(len(x)):

    sum_x += int(x[i])

  if sum_x >= a and sum_x <= b:

    count += xx

print(count)

def find_sum_of_digits(n):

  sum = 0

  while(n>0):

    sum += n%10

    n = int(n/10)

  return sum



n, a, b = list(map(int, input().split()))

count = 0



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

  x = find_sum_of_digits(i)

  if x >= a and x <= b:

    count += i

print(count)

n, a, b = list(map(int, input().split()))
count = 0
for xx in range(1, n + 1):
    x = str(xx)
    sum_x = 0
    for i in range(len(x)):
        sum_x += int(x[i])
    if sum_x >= a and sum_x <= b:
        count += xx
print(count)

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


n, a, b = list(map(int, input().split()))
count = 0
for i in range(1, n + 1):
    x = find_sum_of_digits(i)
    if x >= a and x <= b:
        count += i
print(count)

+def find_sum_of_digits(n): +    sum = 0 +    while n > 0: +        sum += n % 10 +        n = int(n / 10) +    return sum + + -for xx in range(1, n + 1): -    x = str(xx) -    sum_x = 0 -    for i in range(len(x)): -        sum_x += int(x[i]) -    if sum_x >= a and sum_x <= b: -        count += xx +for i in range(1, n + 1): +    x = find_sum_of_digits(i) +    if x >= a and x <= b: +        count += i