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

ans_list = []



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

    if i < 10:

        if i >= A and i <=B:

            ans_list.append(i)

    else:

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

        temp=sum(temp)

        if temp >=A and temp<=B:

            ans_list.append(i)

            

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

ans_list = []



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



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

    temp=sum(temp)

    if temp >=A and temp<=B:

        ans_list.append(i)

            

print((sum(ans_list)))
N, A, B = list(map(int, input().split()))
ans_list = []
for i in range(0, N + 1):
    if i < 10:
        if i >= A and i <= B:
            ans_list.append(i)
    else:
        temp = list(map(int, str(i)))
        temp = sum(temp)
        if temp >= A and temp <= B:
            ans_list.append(i)
print((sum(ans_list)))

N, A, B = list(map(int, input().split()))
ans_list = []
for i in range(0, N + 1):
    temp = list(map(int, str(i)))
    temp = sum(temp)
    if temp >= A and temp <= B:
        ans_list.append(i)
print((sum(ans_list)))

-    if i < 10: -        if i >= A and i <= B: -            ans_list.append(i) -    else: -        temp = list(map(int, str(i))) -        temp = sum(temp) -        if temp >= A and temp <= B: -            ans_list.append(i) +    temp = list(map(int, str(i))) +    temp = sum(temp) +    if temp >= A and temp <= B: +        ans_list.append(i)