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

listint=[i for i in range(1,n+1)]

liststr=[str(listint[i]) for i in range(n)]

anssum=[[] for i in range(n)]

def calculate_sum(listint,liststr,k):

  sumnumber=liststr[k-1]

  sumlist=list(sumnumber)

  sumlistint=[int(sumlist[i]) for i in range(len(sumlist))]

  sum=0

  for i in range(len(sumlistint)):

    sum=sum+sumlistint[i]

  return(sum)

for k in range(0,n):

  anssum[k]=[listint[k],calculate_sum(listint,liststr,k+1)]

answer=0

for i in range(0,n):

  if a<=anssum[i][1]<=b:

    answer=answer+anssum[i][0]

print(answer)

    

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

answer=0

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

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

      answer=answer+i

print(answer)

      
n, a, b = list(map(int, input().split()))
listint = [i for i in range(1, n + 1)]
liststr = [str(listint[i]) for i in range(n)]
anssum = [[] for i in range(n)]


def calculate_sum(listint, liststr, k):
    sumnumber = liststr[k - 1]
    sumlist = list(sumnumber)
    sumlistint = [int(sumlist[i]) for i in range(len(sumlist))]
    sum = 0
    for i in range(len(sumlistint)):
        sum = sum + sumlistint[i]
    return sum


for k in range(0, n):
    anssum[k] = [listint[k], calculate_sum(listint, liststr, k + 1)]
answer = 0
for i in range(0, n):
    if a <= anssum[i][1] <= b:
        answer = answer + anssum[i][0]
print(answer)

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

-listint = [i for i in range(1, n + 1)] -liststr = [str(listint[i]) for i in range(n)] -anssum = [[] for i in range(n)] - - -def calculate_sum(listint, liststr, k): -    sumnumber = liststr[k - 1] -    sumlist = list(sumnumber) -    sumlistint = [int(sumlist[i]) for i in range(len(sumlist))] -    sum = 0 -    for i in range(len(sumlistint)): -        sum = sum + sumlistint[i] -    return sum - - -for k in range(0, n): -    anssum[k] = [listint[k], calculate_sum(listint, liststr, k + 1)] -for i in range(0, n): -    if a <= anssum[i][1] <= b: -        answer = answer + anssum[i][0] +for i in range(1, n + 1): +    if a <= sum(map(int, str(i))) <= b: +        answer = answer + i