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



ans = 0



for i in range(N+1):

    wa = 0

    for k in range(len(str(i))):

        wa += int(str(i)[k])

    if A <= wa <= 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:

        ans += i

print(ans)
N, A, B = list(map(int, input().split(" ")))
ans = 0
for i in range(N + 1):
    wa = 0
    for k in range(len(str(i))):
        wa += int(str(i)[k])
    if A <= wa <= 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:
        ans += i
print(ans)

-N, A, B = list(map(int, input().split(" "))) +n, a, b = list(map(int, input().split())) -for i in range(N + 1): -    wa = 0 -    for k in range(len(str(i))): -        wa += int(str(i)[k]) -    if A <= wa <= B: +for i in range(n + 1): +    if a <= sum(list(map(int, list(str(i))))) <= b: