from sys import stdin





if __name__ == "__main__":

    _in = [_.rstrip() for _ in stdin.readlines()]

    N, A, B = list(map(int,_in[0].split(' ')))  # type:list(int)

    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

    cnt = 0

    for n in range(N+1):

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

        if A <= _sum <= B:

            cnt += n

    ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    print(cnt)

from sys import stdin





def find_sum_of_digits(n, base=10):

    _sum = 0

    while n>0:

        _sum += n%base

        n //= base

    return _sum





if __name__ == "__main__":

    _in = [_.rstrip() for _ in stdin.readlines()]

    N, A, B = list(map(int,_in[0].split(' ')))  # type:list(int)

    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

    cnt = 0

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

        _sum = find_sum_of_digits(n)

        if A <= _sum <= B:

            cnt += n

    ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    print(cnt)

from sys import stdin

if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N, A, B = list(map(int, _in[0].split(" ")))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = 0
    for n in range(N + 1):
        _sum = sum(list(map(int, list(str(n)))))
        if A <= _sum <= B:
            cnt += n
    ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)

from sys import stdin


def find_sum_of_digits(n, base=10):
    _sum = 0
    while n > 0:
        _sum += n % base
        n //= base
    return _sum


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N, A, B = list(map(int, _in[0].split(" ")))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = 0
    for n in range(1, N + 1):
        _sum = find_sum_of_digits(n)
        if A <= _sum <= B:
            cnt += n
    ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)

+ + +def find_sum_of_digits(n, base=10): +    _sum = 0 +    while n > 0: +        _sum += n % base +        n //= base +    return _sum + -    for n in range(N + 1): -        _sum = sum(list(map(int, list(str(n))))) +    for n in range(1, N + 1): +        _sum = find_sum_of_digits(n)