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

f = []

s = []

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

    c = str(i)

    for j in range(len(c)):

        s.append(int(c[j]))

    if sum(s[:5])>=a and sum(s[:5])<=b:

        f.append(i)

    s=[]

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

s = 0

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

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

    if d>=a and d<=b:

        s+=i

print(s)
n, a, b = list(map(int, input().split()))
f = []
s = []
for i in range(a, n + 1):
    c = str(i)
    for j in range(len(c)):
        s.append(int(c[j]))
    if sum(s[:5]) >= a and sum(s[:5]) <= b:
        f.append(i)
    s = []
print((sum(f)))

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

-f = [] -s = [] -for i in range(a, n + 1): -    c = str(i) -    for j in range(len(c)): -        s.append(int(c[j])) -    if sum(s[:5]) >= a and sum(s[:5]) <= b: -        f.append(i) -    s = [] -print((sum(f))) +s = 0 +for i in range(1, n + 1): +    d = sum(list(map(int, str(i)))) +    if d >= a and d <= b: +        s += i +print(s)