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

l=[]

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

    tmp=0

    tmp_l=[]

    for j in range(len(str(i))):#各桁の和を算出

        tmp_l.append(int(str(i)[j]))

        tmp=sum(tmp_l)

    if a<= tmp <=b:

        l.append(i)

        

ans=sum(l)

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

ans = 0

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

    wa = 0

    for j in range(len(str(i))):

        wa += int(str(i)[j])

    if wa>= a and wa<=b:

        ans+=i

print(ans)
n, a, b = list(map(int, input().split()))
l = []
for i in range(1, n + 1):
    tmp = 0
    tmp_l = []
    for j in range(len(str(i))):  # 各桁の和を算出
        tmp_l.append(int(str(i)[j]))
        tmp = sum(tmp_l)
    if a <= tmp <= b:
        l.append(i)
ans = sum(l)
print(ans)

n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    wa = 0
    for j in range(len(str(i))):
        wa += int(str(i)[j])
    if wa >= a and wa <= b:
        ans += i
print(ans)

-l = [] +ans = 0 -    tmp = 0 -    tmp_l = [] -    for j in range(len(str(i))):  # 各桁の和を算出 -        tmp_l.append(int(str(i)[j])) -        tmp = sum(tmp_l) -    if a <= tmp <= b: -        l.append(i) -ans = sum(l) +    wa = 0 +    for j in range(len(str(i))): +        wa += int(str(i)[j]) +    if wa >= a and wa <= b: +        ans += i