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

ans = 0

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

    s = sum(map(int,list(str(n))))

    if A <= s <= B:

        ans += n

print(ans)

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

ans = 0

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

    s = sum(map(int,str(n)))

    if A <= s <= B: ans += n

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

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

-    s = sum(map(int, list(str(n)))) +    s = sum(map(int, str(n)))