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



ans = 0

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

    digits = list(map(int, list(str(i))))

    i_sum = sum(digits)

    if a <= i_sum <= b:

        ans += i



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

ans = 0

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

    s = 0

    j = i

    while i > 0:

        s += i % 10

        i //= 10

    if A <= s <= B:

        ans += j

print(ans)



n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    digits = list(map(int, list(str(i))))
    i_sum = sum(digits)
    if a <= i_sum <= b:
        ans += i
print(ans)

N, A, B = list(map(int, input().split()))
ans = 0
for i in range(1, N + 1):
    s = 0
    j = i
    while i > 0:
        s += i % 10
        i //= 10
    if A <= s <= B:
        ans += j
print(ans)

-n, a, b = list(map(int, input().split())) +N, A, B = list(map(int, input().split())) -for i in range(1, n + 1): -    digits = list(map(int, list(str(i)))) -    i_sum = sum(digits) -    if a <= i_sum <= b: -        ans += i +for i in range(1, N + 1): +    s = 0 +    j = i +    while i > 0: +        s += i % 10 +        i //= 10 +    if A <= s <= B: +        ans += j