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

cnt=0

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

    if a<=sum(list(map(int,str(i))))<=b:

        cnt+=i

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

cnt=0

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

    if a<=sum(map(int,str(i)))<=b:

        cnt+=i

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

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

-    if a <= sum(list(map(int, str(i)))) <= b: +    if a <= sum(map(int, str(i))) <= b: