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

ans = 0

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

    x = (sum(list(map(int, list(str(i))))))

    if A <= x <= B:

        ans += i

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

ans = 0





def sumDigits(n):

    sum = 0

    while n != 0:

        sum += n % 10

        n = n // 10

    return sum





for i in range(N+1):

    x = sumDigits(i)

    if A <= x <= B:

        ans += i



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

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


def sumDigits(n):
    sum = 0
    while n != 0:
        sum += n % 10
        n = n // 10
    return sum


for i in range(N + 1):
    x = sumDigits(i)
    if A <= x <= B:
        ans += i
print(ans)

-for i in range(1, N + 1): -    x = sum(list(map(int, list(str(i))))) + + +def sumDigits(n): +    sum = 0 +    while n != 0: +        sum += n % 10 +        n = n // 10 +    return sum + + +for i in range(N + 1): +    x = sumDigits(i)