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

sum = 0

ans = 0

for i in range (N+1):

  for j in range (len(str(i))):

    sum += int(str(i)[j])

  if A <= sum  and sum <= B:

    ans += i

  sum = 0

print(ans)

  

def keta(n):

  sum = 0

  while n>0:

    sum += n%10 

    n = n//10 

  return(sum)

def mium():

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

  ans = 0

  for i in range (N):

    a = keta(i+1)

    if A <= a and a <= B:

      ans += i+1

  print(ans)

if __name__ == "__main__":

  mium()
N, A, B = list(map(int, input().split()))
sum = 0
ans = 0
for i in range(N + 1):
    for j in range(len(str(i))):
        sum += int(str(i)[j])
    if A <= sum and sum <= B:
        ans += i
    sum = 0
print(ans)

def keta(n):
    sum = 0
    while n > 0:
        sum += n % 10
        n = n // 10
    return sum


def mium():
    N, A, B = list(map(int, input().split()))
    ans = 0
    for i in range(N):
        a = keta(i + 1)
        if A <= a and a <= B:
            ans += i + 1
    print(ans)


if __name__ == "__main__":
    mium()

-N, A, B = list(map(int, input().split())) -sum = 0 -ans = 0 -for i in range(N + 1): -    for j in range(len(str(i))): -        sum += int(str(i)[j]) -    if A <= sum and sum <= B: -        ans += i +def keta(n): -print(ans) +    while n > 0: +        sum += n % 10 +        n = n // 10 +    return sum + + +def mium(): +    N, A, B = list(map(int, input().split())) +    ans = 0 +    for i in range(N): +        a = keta(i + 1) +        if A <= a and a <= B: +            ans += i + 1 +    print(ans) + + +if __name__ == "__main__": +    mium()