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



ans = 0

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

    num_str = str(i)

    sum = 0

    for j in num_str:

        sum += int(j)

    if a <= sum and sum <= b:

        ans += i



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

# n = int(input())



def get_sum(i):

    sum = 0

    while i > 0:

        sum += (i%10)

        i = int(i/10)

    return sum



cnt = 0

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

    sum = get_sum(i)

    if sum >= a and sum <= b:

        cnt += i



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

n, a, b = list(map(int, input().split()))
# n = int(input())
def get_sum(i):
    sum = 0
    while i > 0:
        sum += i % 10
        i = int(i / 10)
    return sum


cnt = 0
for i in range(1, n + 1):
    sum = get_sum(i)
    if sum >= a and sum <= b:
        cnt += i
print(cnt)

-ans = 0 +# n = int(input()) +def get_sum(i): +    sum = 0 +    while i > 0: +        sum += i % 10 +        i = int(i / 10) +    return sum + + +cnt = 0 -    num_str = str(i) -    sum = 0 -    for j in num_str: -        sum += int(j) -    if a <= sum and sum <= b: -        ans += i -print(ans) +    sum = get_sum(i) +    if sum >= a and sum <= b: +        cnt += i +print(cnt)