n,a,b = list(map(int, input().split()))

ans = 0



def sum(k):

  s = 0

  for j in range(len(k)):

    s+=int(k[j])

  return s



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

  if a<=sum(str(i))<=b:

    ans+=i

print(ans)

def findSumDigit(num):

    global total

    total = 0

    while num > 0:

        total += num % 10

        num //= 10

    return total



def main():

    n,a,b = list(map(int, input().split()))

    ans = 0

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

        tmp = findSumDigit(i)

        if a <= tmp <= b:

            ans += i

    print(ans)

    

if __name__ == '__main__':

    main()
n, a, b = list(map(int, input().split()))
ans = 0


def sum(k):
    s = 0
    for j in range(len(k)):
        s += int(k[j])
    return s


for i in range(1, n + 1):
    if a <= sum(str(i)) <= b:
        ans += i
print(ans)

def findSumDigit(num):
    global total
    total = 0
    while num > 0:
        total += num % 10
        num //= 10
    return total


def main():
    n, a, b = list(map(int, input().split()))
    ans = 0
    for i in range(1, n + 1):
        tmp = findSumDigit(i)
        if a <= tmp <= b:
            ans += i
    print(ans)


if __name__ == "__main__":
    main()

-n, a, b = list(map(int, input().split())) -ans = 0 +def findSumDigit(num): +    global total +    total = 0 +    while num > 0: +        total += num % 10 +        num //= 10 +    return total -def sum(k): -    s = 0 -    for j in range(len(k)): -        s += int(k[j]) -    return s +def main(): +    n, a, b = list(map(int, input().split())) +    ans = 0 +    for i in range(1, n + 1): +        tmp = findSumDigit(i) +        if a <= tmp <= b: +            ans += i +    print(ans) -for i in range(1, n + 1): -    if a <= sum(str(i)) <= b: -        ans += i -print(ans) +if __name__ == "__main__": +    main()