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



Sum = 0

for i in range(N):

  o = (i+1)//10000

  a = (i+1)%10000//1000

  b = (i+1)%1000//100

  c = (i+1)%100//10

  d = (i+1)%10

  e= o+a+b+c+d

  if e >= A and e <= B:

    Sum = Sum + (i+1)



print(Sum)
def FindSumOfDigits(n):

  Sum = 0

  while n>0:

    Sum += n%10

    n //= 10

  return Sum



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

total = 0

for i in range(N):

  Sum = FindSumOfDigits(i+1)

  if A <= Sum and Sum <= B:

    total += i+1



print(total)

N, A, B = list(map(int, input().split()))
Sum = 0
for i in range(N):
    o = (i + 1) // 10000
    a = (i + 1) % 10000 // 1000
    b = (i + 1) % 1000 // 100
    c = (i + 1) % 100 // 10
    d = (i + 1) % 10
    e = o + a + b + c + d
    if e >= A and e <= B:
        Sum = Sum + (i + 1)
print(Sum)

def FindSumOfDigits(n):
    Sum = 0
    while n > 0:
        Sum += n % 10
        n //= 10
    return Sum


N, A, B = list(map(int, input().split()))
total = 0
for i in range(N):
    Sum = FindSumOfDigits(i + 1)
    if A <= Sum and Sum <= B:
        total += i + 1
print(total)

+def FindSumOfDigits(n): +    Sum = 0 +    while n > 0: +        Sum += n % 10 +        n //= 10 +    return Sum + + -Sum = 0 +total = 0 -    o = (i + 1) // 10000 -    a = (i + 1) % 10000 // 1000 -    b = (i + 1) % 1000 // 100 -    c = (i + 1) % 100 // 10 -    d = (i + 1) % 10 -    e = o + a + b + c + d -    if e >= A and e <= B: -        Sum = Sum + (i + 1) -print(Sum) +    Sum = FindSumOfDigits(i + 1) +    if A <= Sum and Sum <= B: +        total += i + 1 +print(total)