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

count = 0



for i in range(n+1):

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

        count += i



print(count)

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

ans = 0



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

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

    if a<= sum(digit_list) <=b:

        ans += i



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

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

-count = 0 -for i in range(n + 1): -    if ( -        sum(list(map(int, list(str(i))))) >= a -        and sum(list(map(int, list(str(i))))) <= b -    ): -        count += i -print(count) +ans = 0 +for i in range(1, n + 1): +    digit_list = list(map(int, list(str(i)))) +    if a <= sum(digit_list) <= b: +        ans += i +print(ans)