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

value = cnt = 0

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

    lst = []

    lst = list(str(i))

    for num in lst:

        value += int(num)

    if a <= value <= b:

    	cnt += i

    value = 0

print(cnt)
def sums(n):

    ans = 0

    while n > 0:

        a = n%10

        n = n//10

        ans += a

    return(ans)



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

ans = 0

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

    sum = sums(i)

    if A <= sum <= B:

        ans += i

print(ans)

n, a, b = list(map(int, input().split()))
value = cnt = 0
for i in range(1, n + 1):
    lst = []
    lst = list(str(i))
    for num in lst:
        value += int(num)
    if a <= value <= b:
        cnt += i
    value = 0
print(cnt)

def sums(n):
    ans = 0
    while n > 0:
        a = n % 10
        n = n // 10
        ans += a
    return ans


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

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