

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

LIST_RESULT = []



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

    str_i = str(i)

    l = len(str_i)



    sum_tmp = 0

    for x in range(l):

        sum_tmp += int(str_i[x])

    if A <= sum_tmp and sum_tmp <= B:

        LIST_RESULT.append(i)



sum_result = sum(LIST_RESULT)

print(sum_result)

# coding: utf-8

"""this is python work script"""

def solve(N, A, B):

    LIST_RESULT = []

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

        str_i = str(i)

        l = len(str_i)



        sum_tmp = 0

        for x in range(l):

            sum_tmp += int(str_i[x])

        if A <= sum_tmp and sum_tmp <= B:

            LIST_RESULT.append(i)

    sum_result = sum(LIST_RESULT)

    return sum_result



def main():

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

    answer = solve(N, A, B)

    print(answer)



if __name__ == '__main__':

    main()

N, A, B = list(map(int, input().rstrip().split(" ")))
LIST_RESULT = []
for i in range(1, N + 1):
    str_i = str(i)
    l = len(str_i)
    sum_tmp = 0
    for x in range(l):
        sum_tmp += int(str_i[x])
    if A <= sum_tmp and sum_tmp <= B:
        LIST_RESULT.append(i)
sum_result = sum(LIST_RESULT)
print(sum_result)

# coding: utf-8
"""this is python work script"""


def solve(N, A, B):
    LIST_RESULT = []
    for i in range(1, N + 1):
        str_i = str(i)
        l = len(str_i)
        sum_tmp = 0
        for x in range(l):
            sum_tmp += int(str_i[x])
        if A <= sum_tmp and sum_tmp <= B:
            LIST_RESULT.append(i)
    sum_result = sum(LIST_RESULT)
    return sum_result


def main():
    N, A, B = list(map(int, input().rstrip().split(" ")))
    answer = solve(N, A, B)
    print(answer)


if __name__ == "__main__":
    main()

-N, A, B = list(map(int, input().rstrip().split(" "))) -LIST_RESULT = [] -for i in range(1, N + 1): -    str_i = str(i) -    l = len(str_i) -    sum_tmp = 0 -    for x in range(l): -        sum_tmp += int(str_i[x]) -    if A <= sum_tmp and sum_tmp <= B: -        LIST_RESULT.append(i) -sum_result = sum(LIST_RESULT) -print(sum_result) +# coding: utf-8 +"""this is python work script""" + + +def solve(N, A, B): +    LIST_RESULT = [] +    for i in range(1, N + 1): +        str_i = str(i) +        l = len(str_i) +        sum_tmp = 0 +        for x in range(l): +            sum_tmp += int(str_i[x]) +        if A <= sum_tmp and sum_tmp <= B: +            LIST_RESULT.append(i) +    sum_result = sum(LIST_RESULT) +    return sum_result + + +def main(): +    N, A, B = list(map(int, input().rstrip().split(" "))) +    answer = solve(N, A, B) +    print(answer) + + +if __name__ == "__main__": +    main()