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

data = []

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

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

        data.append(i)

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

ans = 0

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

    if a<=sum([int(s) for s in str(i)])<=b:

    	ans += i

print(ans)
n, a, b = list(map(int, input().split()))
data = []
for i in range(1, n + 1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        data.append(i)
print((sum(data)))

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

-data = [] +ans = 0 -    if a <= sum(list(map(int, list(str(i))))) <= b: -        data.append(i) -print((sum(data))) +    if a <= sum([int(s) for s in str(i)]) <= b: +        ans += i +print(ans)