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

result = 0

for i in range(N+1):

    if A<=sum((list(map(int, str(i)))))<=B:

        result += i

print(result)
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()))
result = 0
for i in range(N + 1):
    if A <= sum((list(map(int, str(i))))) <= B:
        result += i
print(result)

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)))

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