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

num = 0

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

    if A <= sum(int(n) for n in str(i)) <= B:

        num += i

print(num)

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

print((sum(i for i in range(1, N+1) if A <= sum(map(int, str(i))) <= B)))

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

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

-num = 0 -for i in range(1, N + 1): -    if A <= sum(int(n) for n in str(i)) <= B: -        num += i -print(num) +print((sum(i for i in range(1, N + 1) if A <= sum(map(int, str(i))) <= B)))