INPUT=eval(input())

IN=INPUT.split(" ")

#N=int(IN[0])

number=int(IN[0])

#N

A=int(IN[1])

B=int(IN[2])



GOUKEI=0

kazu=0



while kazu<=number:

    X=list(map(int,list(str(kazu))))

    #X = list(map(int, n))

   

    #print(X)

    if A<=sum(X)<=B:

        GOUKEI+=kazu

        #print("add",kazu)

    kazu+=1

print(GOUKEI)

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



sum_N = 0

for i in range(N+1):

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

        sum_N += i



print(sum_N)

INPUT = eval(input())
IN = INPUT.split(" ")
# N=int(IN[0])
number = int(IN[0])
# N
A = int(IN[1])
B = int(IN[2])
GOUKEI = 0
kazu = 0
while kazu <= number:
    X = list(map(int, list(str(kazu))))
    # X = list(map(int, n))
    # print(X)
    if A <= sum(X) <= B:
        GOUKEI += kazu
        # print("add",kazu)
    kazu += 1
print(GOUKEI)

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

-INPUT = eval(input()) -IN = INPUT.split(" ") -# N=int(IN[0]) -number = int(IN[0]) -# N -A = int(IN[1]) -B = int(IN[2]) -GOUKEI = 0 -kazu = 0 -while kazu <= number: -    X = list(map(int, list(str(kazu)))) -    # X = list(map(int, n)) -    # print(X) -    if A <= sum(X) <= B: -        GOUKEI += kazu -        # print("add",kazu) -    kazu += 1 -print(GOUKEI) +N, A, B = list(map(int, input().split())) +sum_N = 0 +for i in range(N + 1): +    if A <= sum(list(map(int, list(str(i))))) <= B: +        sum_N += i +print(sum_N)