def main():

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

    #print('N:%d A:%d B: %d' % (N,A,B)) 



    answer = []

    for i in range(N+1):

        s = sum( map(int,list(str(i)) )) # list of int -> sum

        if s >= A and s <= B: answer.append(i)

        #print('i:%d s:%d' % (i,s))

    print((sum(answer)))



if __name__ == "__main__":

    main()
import sys

def main():

    input = sys.stdin.readline()

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

    #print('N:%d A:%d B: %d' % (N,A,B)) 



    answer = []

    for i in range(N+1):

        s = sum( map(int,list(str(i)) )) # list of int -> sum

        if s >= A and s <= B: answer.append(i)

        #print('i:%d s:%d' % (i,s))

    print((sum(answer)))



if __name__ == "__main__":

    main()
def main():
    N, A, B = list(map(int, input().split()))
    # print('N:%d A:%d B: %d' % (N,A,B))
    answer = []
    for i in range(N + 1):
        s = sum(map(int, list(str(i))))  # list of int -> sum
        if s >= A and s <= B:
            answer.append(i)
        # print('i:%d s:%d' % (i,s))
    print((sum(answer)))


if __name__ == "__main__":
    main()

import sys


def main():
    input = sys.stdin.readline()
    N, A, B = list(map(int, input.split()))
    # print('N:%d A:%d B: %d' % (N,A,B))
    answer = []
    for i in range(N + 1):
        s = sum(map(int, list(str(i))))  # list of int -> sum
        if s >= A and s <= B:
            answer.append(i)
        # print('i:%d s:%d' % (i,s))
    print((sum(answer)))


if __name__ == "__main__":
    main()

+import sys + + -    N, A, B = list(map(int, input().split())) +    input = sys.stdin.readline() +    N, A, B = list(map(int, input.split()))