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

total_sum = 0

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

    total = 0

    for j in range(len(str(i))):

        total += int(str(i)[j])

    if a <= total <= b:

        total_sum += i

print(total_sum)

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

s = 0

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

    t = str(i)

    total = sum(list(map(int, list(t))))

    if a <= total <= b:

        s += i

print(s)

n, a, b = list(map(int, input().split()))
total_sum = 0
for i in range(1, n + 1):
    total = 0
    for j in range(len(str(i))):
        total += int(str(i)[j])
    if a <= total <= b:
        total_sum += i
print(total_sum)

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

-total_sum = 0 +s = 0 -    total = 0 -    for j in range(len(str(i))): -        total += int(str(i)[j]) +    t = str(i) +    total = sum(list(map(int, list(t)))) -        total_sum += i -print(total_sum) +        s += i +print(s)