def main():

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

    ans = 0

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

        t = sum(list(map(int, list(str(i)))))

        if A <= t <= B:

            ans += i

    print(ans)





main()

def main():

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

    ans = 0

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

        if A <= sum(map(int, str(i))) <= B:

            ans += i

    print(ans)





main()

def main():
    N, A, B = list(map(int, input().split()))
    ans = 0
    for i in range(1, N + 1):
        t = sum(list(map(int, list(str(i)))))
        if A <= t <= B:
            ans += i
    print(ans)


main()

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


main()

-        t = sum(list(map(int, list(str(i))))) -        if A <= t <= B: +        if A <= sum(map(int, str(i))) <= B: