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

ans = 0

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

    if a <= sum(list(map(int,str(i)))) <= b:

        ans += i

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

ans = 0

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

    tmp = 0

    q = i

    while q > 0:

        tmp += q % 10

        q //= 10

    if a <= tmp <= b:

        ans += i

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

n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    tmp = 0
    q = i
    while q > 0:
        tmp += q % 10
        q //= 10
    if a <= tmp <= b:
        ans += i
print(ans)

-    if a <= sum(list(map(int, str(i)))) <= b: +    tmp = 0 +    q = i +    while q > 0: +        tmp += q % 10 +        q //= 10 +    if a <= tmp <= b: