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).
N, A, B = map(int, input().split())
c = 0
for i in range(N):
  a = i%10
  i = i//10
  b = i%10
  i = i//10
  c = i%10
  i = i//10
  d = i%10
  i = i//10
  e = i
  if A <= (a+b+c+d+e) <= B:
    c += 1
print(c)
N, A, B = map(int, input().split())
s = 0
for i in range(1,N+1):
  a = i%10
  b = (i//10)%10
  c = (i//100)%10
  d = (i//1000)%10
  e = (i//10000)%10
  f = (a+b+c+d+e)
  if A <= f <= B:
    s += i
print(s)