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

C = [i for i in range(A,N+1)]

D = [i for i in range(A,10) if i <= B]

for c in C:

    if c >= 10:

        str_c = str(c)

        len_c = len(str_c)

        sum_c = 0

        for i in range(len_c):

            sum_c += int(str_c[i])

        if A <= sum_c <= B:

            D.append(c)

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

res = 0

for i in range(N+1):

    if A <= sum([int(s) for s in str(i)]) <= B:

        res += i

print(res)
N, A, B = list(map(int, input().split()))
C = [i for i in range(A, N + 1)]
D = [i for i in range(A, 10) if i <= B]
for c in C:
    if c >= 10:
        str_c = str(c)
        len_c = len(str_c)
        sum_c = 0
        for i in range(len_c):
            sum_c += int(str_c[i])
        if A <= sum_c <= B:
            D.append(c)
print((sum(D)))

N, A, B = list(map(int, input().split()))
res = 0
for i in range(N + 1):
    if A <= sum([int(s) for s in str(i)]) <= B:
        res += i
print(res)

-C = [i for i in range(A, N + 1)] -D = [i for i in range(A, 10) if i <= B] -for c in C: -    if c >= 10: -        str_c = str(c) -        len_c = len(str_c) -        sum_c = 0 -        for i in range(len_c): -            sum_c += int(str_c[i]) -        if A <= sum_c <= B: -            D.append(c) -print((sum(D))) +res = 0 +for i in range(N + 1): +    if A <= sum([int(s) for s in str(i)]) <= B: +        res += i +print(res)