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

ans = 0

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

    s = sum(list(map(int, list(str(i)))))

    if a <= s and s <= b:

        ans += i

print(ans)

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

ans = 0

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

    j = i

    d = 0

    while j != 0:

        d += j % 10

        j //= 10

    if a <= d and d <= b:

        ans += i

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

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

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