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

answer = 0



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

    l = [int(x) for x in list(str(i))]

    if A <= sum(l) <= B: answer += i



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



ans = 0

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

    x = 0

    for s in str(i):

        x += int(s)

    if A <= x <= B:

        ans += i



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

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

-answer = 0 +ans = 0 -    l = [int(x) for x in list(str(i))] -    if A <= sum(l) <= B: -        answer += i -print(answer) +    x = 0 +    for s in str(i): +        x += int(s) +    if A <= x <= B: +        ans += i +print(ans)