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



ans = 0

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

    si = list(str(i))

    s = sum(map(int, si))

    if a <= s <= b:

        ans += i

print(ans)

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

ans = 0

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

    s = 0

    i_ = i

    while i_ > 0:

        s += i_%10

        i_ //= 10

    if a <= s <= b:

        ans += i

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

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

-    si = list(str(i)) -    s = sum(map(int, si)) +    s = 0 +    i_ = i +    while i_ > 0: +        s += i_ % 10 +        i_ //= 10