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

ans = 0

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

    L = list(str(i))

    temp = 0

    for l in L:

        temp += int(l)

    if a <= temp <= b:

        ans += i

        

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

ans = 0

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

    temp = sum(map(int, str(i)))

    if a <= temp <= b:

        ans += i

        

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

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

-    L = list(str(i)) -    temp = 0 -    for l in L: -        temp += int(l) +    temp = sum(map(int, str(i)))