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

ans = 0

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

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

        ans += i

print(ans)

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

ans = 0

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

    sum = 0

    j = i

    while j != 0:

        sum += j % 10

        j = j // 10

    if a <= sum <= 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, list(str(i))))) <= b:
        ans += i
print(ans)

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

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