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

result = 0

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

  total = 0

  t = i

  for j in range(5):

    total += t%10

    t = t // 10

  if a <= total <= b:

    result += i

print(result)

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

total = 0

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

  n = i

  tmp = 0

  while(n > 0):

    tmp += n % 10

    n = n // 10

  if a <= tmp <= b:

    total += i

print(total)
n, a, b = list(map(int, input().split()))
result = 0
for i in range(1, n + 1):
    total = 0
    t = i
    for j in range(5):
        total += t % 10
        t = t // 10
    if a <= total <= b:
        result += i
print(result)

n, a, b = list(map(int, input().split()))
total = 0
for i in range(1, n + 1):
    n = i
    tmp = 0
    while n > 0:
        tmp += n % 10
        n = n // 10
    if a <= tmp <= b:
        total += i
print(total)

-result = 0 +total = 0 -    total = 0 -    t = i -    for j in range(5): -        total += t % 10 -        t = t // 10 -    if a <= total <= b: -        result += i -print(result) +    n = i +    tmp = 0 +    while n > 0: +        tmp += n % 10 +        n = n // 10 +    if a <= tmp <= b: +        total += i +print(total)