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

l = list(range(1,N+1))

su = 0

for i in l:

    num_li = (list(str(i)))

    num_li = list(map(int,num_li))

    k = sum(num_li)

    if A <= k <= B:su+=i

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

ans = 0

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

    l = sum(map(int,list(str(i))))

    if a<=l<=b:

        ans += i

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

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

-N, A, B = list(map(int, input().split())) -l = list(range(1, N + 1)) -su = 0 -for i in l: -    num_li = list(str(i)) -    num_li = list(map(int, num_li)) -    k = sum(num_li) -    if A <= k <= B: -        su += i -print(su) +n, a, b = list(map(int, input().split())) +ans = 0 +for i in range(1, n + 1): +    l = sum(map(int, list(str(i)))) +    if a <= l <= b: +        ans += i +print(ans)