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

ans = []



def degitsum(x):

	string = str(x)

	array = list(map(int, string))

	return sum(array)



for i in range(N+1):

	if A <= degitsum(i) and degitsum(i) <= B:

		ans.append(i)

	else:

		continue

		

print((sum(ans)))
def degitsum(n):

    ans = 0

    while n/10 != 0:

        ans += n%10

        n = int(n/10)

    return ans



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



ans = 0

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

    if a <= degitsum(i) <= b:

        ans += i

    else:

        continue

        

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


def degitsum(x):
    string = str(x)
    array = list(map(int, string))
    return sum(array)


for i in range(N + 1):
    if A <= degitsum(i) and degitsum(i) <= B:
        ans.append(i)
    else:
        continue
print((sum(ans)))

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


n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    if a <= degitsum(i) <= b:
        ans += i
    else:
        continue
print(ans)

-N, A, B = list(map(int, input().split())) -ans = [] +def degitsum(n): +    ans = 0 +    while n / 10 != 0: +        ans += n % 10 +        n = int(n / 10) +    return ans -def degitsum(x): -    string = str(x) -    array = list(map(int, string)) -    return sum(array) - - -for i in range(N + 1): -    if A <= degitsum(i) and degitsum(i) <= B: -        ans.append(i) +n, a, b = list(map(int, input().split())) +ans = 0 +for i in range(1, n + 1): +    if a <= degitsum(i) <= b: +        ans += i -print((sum(ans))) +print(ans)