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

total = 0

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

  num = str(x)

  digit_total = 0

  for y in range(len(num)):

    digit_total += int(num[y])

  if digit_total >= A and digit_total <= B:

    total += x



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

answer = 0

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

  total = sum(int(d) for d in str(x))

  if A <= total <= B:

    answer += x



print(answer)
N, A, B = list(map(int, input("").split()))
total = 0
for x in range(1, N + 1):
    num = str(x)
    digit_total = 0
    for y in range(len(num)):
        digit_total += int(num[y])
    if digit_total >= A and digit_total <= B:
        total += x
print(total)

N, A, B = list(map(int, input("").split()))
answer = 0
for x in range(1, N + 1):
    total = sum(int(d) for d in str(x))
    if A <= total <= B:
        answer += x
print(answer)

-total = 0 +answer = 0 -    num = str(x) -    digit_total = 0 -    for y in range(len(num)): -        digit_total += int(num[y]) -    if digit_total >= A and digit_total <= B: -        total += x -print(total) +    total = sum(int(d) for d in str(x)) +    if A <= total <= B: +        answer += x +print(answer)