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



total = 0

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

    s = str(i)

    tmp = 0

    for j in s:

        tmp += int(j)

    if a <= tmp <= b:

        total += i

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



ans = 0

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

    tmp = 0

    for j in str(i):

        tmp += int(j)

    if a <= tmp <= b:

        ans += i



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

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

-total = 0 +ans = 0 -    s = str(i) -    for j in s: +    for j in str(i): -        total += i -print(total) +        ans += i +print(ans)