# スペース区切りの整数の入力

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

summation = 0



for i in range(N+1):

    num = i

    total = 0

    while num != 0:

        q, mod = divmod(num, 10)

        total += mod

        num = q

    

    if total >= a and total <= b:

        summation += i

    

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

ans = 0

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

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

        ans += i

print(ans)
# スペース区切りの整数の入力
N, a, b = list(map(int, input().split()))
summation = 0
for i in range(N + 1):
    num = i
    total = 0
    while num != 0:
        q, mod = divmod(num, 10)
        total += mod
        num = q
    if total >= a and total <= b:
        summation += i
print(summation)

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

-# スペース区切りの整数の入力 -N, a, b = list(map(int, input().split())) -summation = 0 -for i in range(N + 1): -    num = i -    total = 0 -    while num != 0: -        q, mod = divmod(num, 10) -        total += mod -        num = q -    if total >= a and total <= b: -        summation += i -print(summation) +N, A, B = list(map(int, input().split())) +ans = 0 +for i in range(1, N + 1): +    if A <= sum(map(int, str(i))) <= B: +        ans += i +print(ans)