# ABC083B - Some Sums

def main():

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

    ans = 0

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

        if a <= sum(map(int, list(str(i)))) <= b:

            ans += i

    print(ans)





if __name__ == "__main__":

    main()
# ABC083B - Some Sums

def main():

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

    ans = sum(i for i in range(1, N + 1) if A <= sum(map(int, str(i))) <= B)

    print(ans)





if __name__ == "__main__":

    main()
# ABC083B - Some Sums
def main():
    n, a, b = list(map(int, input().rstrip().split()))
    ans = 0
    for i in range(1, n + 1):
        if a <= sum(map(int, list(str(i)))) <= b:
            ans += i
    print(ans)


if __name__ == "__main__":
    main()

# ABC083B - Some Sums
def main():
    N, A, B = tuple(map(int, input().split()))
    ans = sum(i for i in range(1, N + 1) if A <= sum(map(int, str(i))) <= B)
    print(ans)


if __name__ == "__main__":
    main()

-    n, a, b = list(map(int, input().rstrip().split())) -    ans = 0 -    for i in range(1, n + 1): -        if a <= sum(map(int, list(str(i)))) <= b: -            ans += i +    N, A, B = tuple(map(int, input().split())) +    ans = sum(i for i in range(1, N + 1) if A <= sum(map(int, str(i))) <= B)