x, min, max = input().rstrip().split()

ans = 0

for i in range(int(x) + 1):

    if int(min) <= sum(map(int, str(i))) <=int(max):

        ans += i

print(ans)

x, min, max = list(map(int, input().split()))

ans = 0

for i in range(x+1):

    if min <= sum(map(int, str(i))) <= max:

        ans += i

print(ans)

x, min, max = input().rstrip().split()
ans = 0
for i in range(int(x) + 1):
    if int(min) <= sum(map(int, str(i))) <= int(max):
        ans += i
print(ans)

x, min, max = list(map(int, input().split()))
ans = 0
for i in range(x + 1):
    if min <= sum(map(int, str(i))) <= max:
        ans += i
print(ans)

-x, min, max = input().rstrip().split() +x, min, max = list(map(int, input().split())) -for i in range(int(x) + 1): -    if int(min) <= sum(map(int, str(i))) <= int(max): +for i in range(x + 1): +    if min <= sum(map(int, str(i))) <= max: