Find the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).
li = list(map(int,input().split()))
N = li[0]
A = li[1]
B = li[2]
count = 0
for i in range(1,N + 1):
  iti = N % 10
  zyuu = (N - iti) / 10 % 10
  hyaku = ((N - iti) / 10 - zyuu) / 10 % 10
  sen = (((N - iti) / 10 - zyuu) / 10  - hyaku) / 10 % 10
  man = ((((N - iti) / 10 - zyuu) / 10 - hyaku) / 10 - sen) / 10 % 10
  total = iti + zyuu + hyaku + sen + man
  if A <= total and B >= total:
    count += 1
print(count)
li = list(map(int,input().split()))
N = li[0]
A = li[1]
B = li[2]
count = 0
for i in range(1,N + 1):
  iti = i % 10
  zyuu = (i - iti) / 10 % 10
  hyaku = ((i - iti) / 10 - zyuu) / 10 % 10
  sen = (((i - iti) / 10 - zyuu) / 10  - hyaku) / 10 % 10
  man = ((((i - iti) / 10 - zyuu) / 10 - hyaku) / 10 - sen) / 10 % 10
  total = iti + zyuu + hyaku + sen + man
  
  if A <= total and B >= total:
    count += i

print(count)