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

total = 0

for i in range(n+1):

    num = [int(d) for d in str(i)]

    if sum(num)>=a and sum(num)<=b:

        total += i

print(total)
N, A, B = [int(i) for i in input().split()]



def func_de(n):

    ans = 0

    while n/10 != 0:

        ans += n % 10

        n //= 10

    return ans



ANS = 0

for i in range(N+1):

    if A <= func_de(i) <= B:

        ANS += i



print(ANS)
n, a, b = list(map(int, input().split()))
total = 0
for i in range(n + 1):
    num = [int(d) for d in str(i)]
    if sum(num) >= a and sum(num) <= b:
        total += i
print(total)

N, A, B = [int(i) for i in input().split()]


def func_de(n):
    ans = 0
    while n / 10 != 0:
        ans += n % 10
        n //= 10
    return ans


ANS = 0
for i in range(N + 1):
    if A <= func_de(i) <= B:
        ANS += i
print(ANS)

-n, a, b = list(map(int, input().split())) -total = 0 -for i in range(n + 1): -    num = [int(d) for d in str(i)] -    if sum(num) >= a and sum(num) <= b: -        total += i -print(total) +N, A, B = [int(i) for i in input().split()] + + +def func_de(n): +    ans = 0 +    while n / 10 != 0: +        ans += n % 10 +        n //= 10 +    return ans + + +ANS = 0 +for i in range(N + 1): +    if A <= func_de(i) <= B: +        ANS += i +print(ANS)