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

ans=0

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

    i=str(i)

    l=len(i)

    s=0

    for j in range(l):

        s+=int(i[j])

    if A<=s<=B:

        ans+=int(i)

        

print(ans)

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

ans=0

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

    temp=0

    i=str(i)

    for j in range(len(i)):

        temp+=int(i[j])

    if A<=temp<=B:

        ans+=int(i)



print(ans)

N, A, B = list(map(int, input().split()))
ans = 0
for i in range(1, N + 1):
    i = str(i)
    l = len(i)
    s = 0
    for j in range(l):
        s += int(i[j])
    if A <= s <= B:
        ans += int(i)
print(ans)

N, A, B = list(map(int, input().split()))
ans = 0
for i in range(1, N + 1):
    temp = 0
    i = str(i)
    for j in range(len(i)):
        temp += int(i[j])
    if A <= temp <= B:
        ans += int(i)
print(ans)

+    temp = 0 -    l = len(i) -    s = 0 -    for j in range(l): -        s += int(i[j]) -    if A <= s <= B: +    for j in range(len(i)): +        temp += int(i[j]) +    if A <= temp <= B: