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

ALlsum = 0



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

    sum = 0

    i = str(i)

    i_len = len(i)

    for j in range(i_len):

        sum += int(i[j])

    if a<=sum and sum<=b :

        ALlsum += int(i)





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



Ssum = 0

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

    tmp = i

    sum = 0

    while i>0 :

        sum += i%10

        i //= 10

    if a<=sum and sum<=b:

        Ssum += tmp



print(Ssum)
n, a, b = list(map(int, input().split()))
ALlsum = 0
for i in range(1, n + 1):
    sum = 0
    i = str(i)
    i_len = len(i)
    for j in range(i_len):
        sum += int(i[j])
    if a <= sum and sum <= b:
        ALlsum += int(i)
print(ALlsum)

n, a, b = list(map(int, input().split()))
Ssum = 0
for i in range(1, n + 1):
    tmp = i
    sum = 0
    while i > 0:
        sum += i % 10
        i //= 10
    if a <= sum and sum <= b:
        Ssum += tmp
print(Ssum)

-ALlsum = 0 +Ssum = 0 +    tmp = i -    i = str(i) -    i_len = len(i) -    for j in range(i_len): -        sum += int(i[j]) +    while i > 0: +        sum += i % 10 +        i //= 10 -        ALlsum += int(i) -print(ALlsum) +        Ssum += tmp +print(Ssum)