def FindSumOfDigits(n):

    Sum=0

    while(n>0):

        Sum+=(int(n%10))

        n=n/10

    return Sum



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

ans=0

#ans_list=[]

#sumlist=[]

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

    #sumlist.append(FindSumOfDigits(i))

    if A<=FindSumOfDigits(i)<=B:

        ans+=i

        #ans_list.append(i)

print(ans)

#print(ans_list)

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

cnt=0

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

    total=0

    total+=n%10

    total+=int(n/10)%10

    total+=int((n/10)/10)%10

    total+=int(((n/10)/10)/10)%10

    total+=int((((n/10)/10)/10)/10)%10

    if A<=total<=B:

        cnt+=n

print(cnt)
def FindSumOfDigits(n):
    Sum = 0
    while n > 0:
        Sum += int(n % 10)
        n = n / 10
    return Sum


N, A, B = list(map(int, input().split()))
ans = 0
# ans_list=[]
# sumlist=[]
for i in range(1, N + 1):
    # sumlist.append(FindSumOfDigits(i))
    if A <= FindSumOfDigits(i) <= B:
        ans += i
        # ans_list.append(i)
print(ans)
# print(ans_list)
# print(sum_list)

N, A, B = list(map(int, input().split()))
cnt = 0
for n in range(1, N + 1):
    total = 0
    total += n % 10
    total += int(n / 10) % 10
    total += int((n / 10) / 10) % 10
    total += int(((n / 10) / 10) / 10) % 10
    total += int((((n / 10) / 10) / 10) / 10) % 10
    if A <= total <= B:
        cnt += n
print(cnt)

-def FindSumOfDigits(n): -    Sum = 0 -    while n > 0: -        Sum += int(n % 10) -        n = n / 10 -    return Sum - - -ans = 0 -# ans_list=[] -# sumlist=[] -for i in range(1, N + 1): -    # sumlist.append(FindSumOfDigits(i)) -    if A <= FindSumOfDigits(i) <= B: -        ans += i -        # ans_list.append(i) -print(ans) -# print(ans_list) -# print(sum_list) +cnt = 0 +for n in range(1, N + 1): +    total = 0 +    total += n % 10 +    total += int(n / 10) % 10 +    total += int((n / 10) / 10) % 10 +    total += int(((n / 10) / 10) / 10) % 10 +    total += int((((n / 10) / 10) / 10) / 10) % 10 +    if A <= total <= B: +        cnt += n +print(cnt)