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

res = 0

for i in range(N+1):

    if A <= sum([int(s) for s in str(i)]) <= B:

        res += i

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

s = 0

for i in range(n+1):

    if a <= sum([int(j) for j in str(i)]) <= b:

        s += i

print(s)
N, A, B = list(map(int, input().split()))
res = 0
for i in range(N + 1):
    if A <= sum([int(s) for s in str(i)]) <= B:
        res += i
print(res)

n, a, b = list(map(int, input().split()))
s = 0
for i in range(n + 1):
    if a <= sum([int(j) for j in str(i)]) <= b:
        s += i
print(s)

-N, A, B = list(map(int, input().split())) -res = 0 -for i in range(N + 1): -    if A <= sum([int(s) for s in str(i)]) <= B: -        res += i -print(res) +n, a, b = list(map(int, input().split())) +s = 0 +for i in range(n + 1): +    if a <= sum([int(j) for j in str(i)]) <= b: +        s += i +print(s)