import sys

input = sys.stdin.readline



INF = float('inf')





def number2digits(number):

    return list(map(int, str(number)))



def main():

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

    ans = 0

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

        num_digits_list = number2digits(number)

        total = 0

        for i in num_digits_list:

            total += int(i)

        if A <= total <= B:

            ans += number



    print(ans)





if __name__ == '__main__':

    main()

import sys

input = sys.stdin.readline



INF = float('inf')





def number2digits(number):

    return list(map(int, str(number)))





def sum_of_digits(number):

    sum = 0

    while number > 0:

        sum += number % 10

        number //= 10

    return sum





def main():

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

    ans = 0

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

        total = sum_of_digits(number)

        if A <= total <= B:

            ans += number



    print(ans)





if __name__ == '__main__':

    main()

import sys

input = sys.stdin.readline
INF = float("inf")


def number2digits(number):
    return list(map(int, str(number)))


def main():
    N, A, B = list(map(int, input().split()))
    ans = 0
    for number in range(1, N + 1):
        num_digits_list = number2digits(number)
        total = 0
        for i in num_digits_list:
            total += int(i)
        if A <= total <= B:
            ans += number
    print(ans)


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline
INF = float("inf")


def number2digits(number):
    return list(map(int, str(number)))


def sum_of_digits(number):
    sum = 0
    while number > 0:
        sum += number % 10
        number //= 10
    return sum


def main():
    N, A, B = list(map(int, input().split()))
    ans = 0
    for number in range(1, N + 1):
        total = sum_of_digits(number)
        if A <= total <= B:
            ans += number
    print(ans)


if __name__ == "__main__":
    main()

+def sum_of_digits(number): +    sum = 0 +    while number > 0: +        sum += number % 10 +        number //= 10 +    return sum + + -        num_digits_list = number2digits(number) -        total = 0 -        for i in num_digits_list: -            total += int(i) +        total = sum_of_digits(number)