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

n = 0

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

  J = 0

  for j in str(i):

    J += int(j)

  

  if A <= J and J <= B:

    n += i

    

print(n) 
[N, A, B] = list(map(int, input().split(" ")))



def numOfSumDigit(n):

  sum = 0

  while n > 0:

    sum += n%10

    n = int(n / 10)

  return sum



total = 0

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

  SUM = numOfSumDigit(i)



  if A <= SUM and SUM <= B:

    total += i

    

print(total)
[N, A, B] = list(map(int, input().split(" ")))
n = 0
for i in range(1, N + 1):
    J = 0
    for j in str(i):
        J += int(j)
    if A <= J and J <= B:
        n += i
print(n)

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


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


total = 0
for i in range(1, N + 1):
    SUM = numOfSumDigit(i)
    if A <= SUM and SUM <= B:
        total += i
print(total)

-n = 0 + + +def numOfSumDigit(n): +    sum = 0 +    while n > 0: +        sum += n % 10 +        n = int(n / 10) +    return sum + + +total = 0 -    J = 0 -    for j in str(i): -        J += int(j) -    if A <= J and J <= B: -        n += i -print(n) +    SUM = numOfSumDigit(i) +    if A <= SUM and SUM <= B: +        total += i +print(total)