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



tot = 0

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

    s = 0

    for c in list(str(i)):

        s += int(c)

    if A<= s <=B:

        tot += i

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



tot = 0

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

    q = i

    s = 0

    while q > 0:

        q, r = divmod(q, 10) #;print(i, q, r, s)

        s += r       

    if A<= s <=B:        

        tot += i #;print(i)

        

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

N, A, B = list(map(int, input().split()))
tot = 0
for i in range(1, N + 1):
    q = i
    s = 0
    while q > 0:
        q, r = divmod(q, 10)  # ;print(i, q, r, s)
        s += r
    if A <= s <= B:
        tot += i  # ;print(i)
print(tot)

+    q = i -    for c in list(str(i)): -        s += int(c) +    while q > 0: +        q, r = divmod(q, 10)  # ;print(i, q, r, s) +        s += r -        tot += i +        tot += i  # ;print(i)