def main():

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



    sumv = 0

    for x in range(a, n+1):

        num = sum([int(i) for i in str(x)])

        if num >= a and num <= b: sumv += x

    print(sumv)





if __name__ == '__main__':

    main()
def sum_digit(x):

    sumv = 0

    while x > 0:

        t = x % 10

        sumv += t

        x = x // 10

    return sumv



if __name__ == '__main__':

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



    ans = 0

    for num in range(a, n+1):

        sumv = sum_digit(num)

        if a <= sumv and sumv <= b:

            ans += num

    print(ans)
def main():
    n, a, b = list(map(int, input().split()))
    sumv = 0
    for x in range(a, n + 1):
        num = sum([int(i) for i in str(x)])
        if num >= a and num <= b:
            sumv += x
    print(sumv)


if __name__ == "__main__":
    main()

def sum_digit(x):
    sumv = 0
    while x > 0:
        t = x % 10
        sumv += t
        x = x // 10
    return sumv


if __name__ == "__main__":
    n, a, b = list(map(int, input().split()))
    ans = 0
    for num in range(a, n + 1):
        sumv = sum_digit(num)
        if a <= sumv and sumv <= b:
            ans += num
    print(ans)

-def main(): -    n, a, b = list(map(int, input().split())) +def sum_digit(x): -    for x in range(a, n + 1): -        num = sum([int(i) for i in str(x)]) -        if num >= a and num <= b: -            sumv += x -    print(sumv) +    while x > 0: +        t = x % 10 +        sumv += t +        x = x // 10 +    return sumv -    main() +    n, a, b = list(map(int, input().split())) +    ans = 0 +    for num in range(a, n + 1): +        sumv = sum_digit(num) +        if a <= sumv and sumv <= b: +            ans += num +    print(ans)