line = list(map(int,input().split()))

n = line[0]

a = line[1]

b = line[2]



nums = []

for num in range(n+1):

  sowa = 0

  count = len(str(num))

  for i in range(count):

    num = str(num)

    sowa += int(num[i])

  if a <= sowa and sowa <= b:

    nums.append(num)

answer = 0

for j in nums:

  answer += int(j)

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

nums = []

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

  summ = sum(list(map(int,str(i))))

  if a <= summ <= b:

    nums.append(i)

print((sum(nums)))
line = list(map(int, input().split()))
n = line[0]
a = line[1]
b = line[2]
nums = []
for num in range(n + 1):
    sowa = 0
    count = len(str(num))
    for i in range(count):
        num = str(num)
        sowa += int(num[i])
    if a <= sowa and sowa <= b:
        nums.append(num)
answer = 0
for j in nums:
    answer += int(j)
print(answer)

n, a, b = list(map(int, input().split()))
nums = []
for i in range(1, n + 1):
    summ = sum(list(map(int, str(i))))
    if a <= summ <= b:
        nums.append(i)
print((sum(nums)))

-line = list(map(int, input().split())) -n = line[0] -a = line[1] -b = line[2] +n, a, b = list(map(int, input().split())) -for num in range(n + 1): -    sowa = 0 -    count = len(str(num)) -    for i in range(count): -        num = str(num) -        sowa += int(num[i]) -    if a <= sowa and sowa <= b: -        nums.append(num) -answer = 0 -for j in nums: -    answer += int(j) -print(answer) +for i in range(1, n + 1): +    summ = sum(list(map(int, str(i)))) +    if a <= summ <= b: +        nums.append(i) +print((sum(nums)))