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

ret = 0

for i in range(N + 1):

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

  if v >= A and v <= B:

    ret += i

print(ret)
def find_sum(n):

  ret = 0

  while(n > 0):

    ret += n % 10

    n = int((n - n % 10) / 10)

  return ret



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

ret = 0

for i in range(N + 1):

  #v = sum(map(int, list(str(i))))

  v = find_sum(i)

  if v >= A and v <= B:

    ret += i

print(ret)
N, A, B = list(map(int, input().split()))
ret = 0
for i in range(N + 1):
    v = sum(map(int, list(str(i))))
    if v >= A and v <= B:
        ret += i
print(ret)

def find_sum(n):
    ret = 0
    while n > 0:
        ret += n % 10
        n = int((n - n % 10) / 10)
    return ret


N, A, B = list(map(int, input().split()))
ret = 0
for i in range(N + 1):
    # v = sum(map(int, list(str(i))))
    v = find_sum(i)
    if v >= A and v <= B:
        ret += i
print(ret)

+def find_sum(n): +    ret = 0 +    while n > 0: +        ret += n % 10 +        n = int((n - n % 10) / 10) +    return ret + + -    v = sum(map(int, list(str(i)))) +    # v = sum(map(int, list(str(i)))) +    v = find_sum(i)