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

result = 0



for i in range(n + 1):

  if a <= sum(list(map(int, list(str(i))))) <= b:

    result += i



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

result = 0



for i in range(n + 1):

  if a <= sum(map(int, list(str(i)))) <= b:

    result += i



print(result)

n, a, b = list(map(int, input().split()))
result = 0
for i in range(n + 1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        result += i
print(result)

n, a, b = list(map(int, input().split()))
result = 0
for i in range(n + 1):
    if a <= sum(map(int, list(str(i)))) <= b:
        result += i
print(result)

-    if a <= sum(list(map(int, list(str(i))))) <= b: +    if a <= sum(map(int, list(str(i)))) <= b: