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



def add(n,a,b):

  res=sum(map(int,list(str(n))))

  return n if res>=a and res<=b else 0



ans=0

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

  ans+=add(i,A,B)

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



def digit_sum(n):

  res = 0

  while n:

    res += n % 10

    n //= 10

  return res



answer = 0

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

  if A <= digit_sum(i) <= B:

    answer += i

    

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


def add(n, a, b):
    res = sum(map(int, list(str(n))))
    return n if res >= a and res <= b else 0


ans = 0
for i in range(1, N + 1):
    ans += add(i, A, B)
print(ans)

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


def digit_sum(n):
    res = 0
    while n:
        res += n % 10
        n //= 10
    return res


answer = 0
for i in range(1, N + 1):
    if A <= digit_sum(i) <= B:
        answer += i
print(answer)

-def add(n, a, b): -    res = sum(map(int, list(str(n)))) -    return n if res >= a and res <= b else 0 +def digit_sum(n): +    res = 0 +    while n: +        res += n % 10 +        n //= 10 +    return res -ans = 0 +answer = 0 -    ans += add(i, A, B) -print(ans) +    if A <= digit_sum(i) <= B: +        answer += i +print(answer)