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

res = []

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

    string = str(i)

    string = list(string)

    string = list(map(int,string))

    t = 0

    for j in string:

        t += j

    if a <= t <= b:

        res.append(i)



total = 0

for i in res:

    total += i

print(total)

        
# coding: utf-8

# Your code here!



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



ans = 0

for i in range(n + 1):

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

        ans += i

        

print(ans)
n, a, b = list(map(int, input().split(" ")))
res = []
for i in range(1, n + 1):
    string = str(i)
    string = list(string)
    string = list(map(int, string))
    t = 0
    for j in string:
        t += j
    if a <= t <= b:
        res.append(i)
total = 0
for i in res:
    total += i
print(total)

# coding: utf-8
# Your code here!
n, a, b = list(map(int, input().split()))
ans = 0
for i in range(n + 1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        ans += i
print(ans)

-n, a, b = list(map(int, input().split(" "))) -res = [] -for i in range(1, n + 1): -    string = str(i) -    string = list(string) -    string = list(map(int, string)) -    t = 0 -    for j in string: -        t += j -    if a <= t <= b: -        res.append(i) -total = 0 -for i in res: -    total += i -print(total) +# coding: utf-8 +# Your code here! +n, a, b = list(map(int, input().split())) +ans = 0 +for i in range(n + 1): +    if a <= sum(list(map(int, list(str(i))))) <= b: +        ans += i +print(ans)