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



ans = 0

for i in range(N + 1):

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

        list(map(int, list(str(i))))

        ans += i

print(ans)



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



ans = 0

for i in range(N + 1):

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

        ans += i

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

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

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