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

ans = 0

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

    si = list(str(i))

    isum = sum(int(k) for k in si)

    if A <= isum <= B:

        ans += i

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



def solve(n):

    if n == 0:

        return 0

    else:

        temp = n % 10

        return temp + solve(n // 10)



ans = 0

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

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

        ans += i

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

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


def solve(n):
    if n == 0:
        return 0
    else:
        temp = n % 10
        return temp + solve(n // 10)


ans = 0
for i in range(1, N + 1):
    if A <= solve(i) <= B:
        ans += i
print(ans)

+ + +def solve(n): +    if n == 0: +        return 0 +    else: +        temp = n % 10 +        return temp + solve(n // 10) + + -    si = list(str(i)) -    isum = sum(int(k) for k in si) -    if A <= isum <= B: +    if A <= solve(i) <= B: