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



numlist = []

for i in range(N+1):

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

   if (A<=sum(num)<=B):

       list.append(numlist,i)

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

numlist = [i for i in range(N+1) if A<=sum(map(int, str(i)))<=B]

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

N, A, B = list(map(int, input().split()))
numlist = [i for i in range(N + 1) if A <= sum(map(int, str(i))) <= B]
print((sum(numlist)))

-numlist = [] -for i in range(N + 1): -    num = list(map(int, str(i))) -    if A <= sum(num) <= B: -        list.append(numlist, i) +numlist = [i for i in range(N + 1) if A <= sum(map(int, str(i))) <= B]