N, A, B = list(map(int, input().split()))

m = 0

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

    C = []

    n1 = n

    for k in range(4, -1, -1):

            C.append(int(n1 / (10 ** k)))

            n1 -= C[4 - k] * (10 ** k)

    if A <= sum(C) <= B:

        m += n

print(m)

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

ans = 0



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

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

        ans += k

print(ans)

N, A, B = list(map(int, input().split()))
m = 0
for n in range(1, N + 1):
    C = []
    n1 = n
    for k in range(4, -1, -1):
        C.append(int(n1 / (10**k)))
        n1 -= C[4 - k] * (10**k)
    if A <= sum(C) <= B:
        m += n
print(m)

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

-N, A, B = list(map(int, input().split())) -m = 0 -for n in range(1, N + 1): -    C = [] -    n1 = n -    for k in range(4, -1, -1): -        C.append(int(n1 / (10**k))) -        n1 -= C[4 - k] * (10**k) -    if A <= sum(C) <= B: -        m += n -print(m) +n, a, b = list(map(int, input().split())) +ans = 0 +for k in range(1, n + 1): +    if a <= sum(map(int, str(k))) <= b: +        ans += k +print(ans)