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

 

ans = 0

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

  if(A <= sum(list(map(int,str(i)))) <= B):

    ans += i

print(ans)
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()))
ans = 0
for i in range(1, N + 1):
    if A <= sum(list(map(int, str(i)))) <= B:
        ans += i
print(ans)

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)

-ans = 0 +cnt = 0 -    if A <= sum(list(map(int, str(i)))) <= B: -        ans += i -print(ans) +    if A <= sum(map(int, str(i))) <= B: +        cnt += i +print(cnt)