n, a, b = [int(x) for x in input().split()]

count = 0

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

    if a <= sum([int(x) for x in list(str(i))]) <= b:

        count += i

print(count)
n, a, b = [int(x) for x in input().split()]

idx = 0

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

    if a <= sum([int(x) for x in str(i)]) <= b:

        idx += i

print(idx)
n, a, b = [int(x) for x in input().split()]
count = 0
for i in range(a, n + 1):
    if a <= sum([int(x) for x in list(str(i))]) <= b:
        count += i
print(count)

n, a, b = [int(x) for x in input().split()]
idx = 0
for i in range(1, n + 1):
    if a <= sum([int(x) for x in str(i)]) <= b:
        idx += i
print(idx)

-count = 0 -for i in range(a, n + 1): -    if a <= sum([int(x) for x in list(str(i))]) <= b: -        count += i -print(count) +idx = 0 +for i in range(1, n + 1): +    if a <= sum([int(x) for x in str(i)]) <= b: +        idx += i +print(idx)