n,a,b=input().split()

n,a,b=int(n),int(a),int(b)

m=len(str(n))

'''

c=0

if n==10**4 and A==1:

    c=1

k=len(str(n))

for i in range(k):

'''

c=0

for i in range(n):

    #map関数はクソ便利

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

         c+=i+1



print(c)

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

ans=0

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

    s=0

    j=i

    while j!=0:

        s+=(j%10)

        j//=10

    if a<=s<=b:ans+=i

print(ans)
n, a, b = input().split()
n, a, b = int(n), int(a), int(b)
m = len(str(n))
"""
c=0
if n==10**4 and A==1:
    c=1
k=len(str(n))
for i in range(k):
"""
c = 0
for i in range(n):
    # map関数はクソ便利
    if a <= sum(list(map(int, str(i + 1)))) <= b:
        c += i + 1
print(c)

n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    s = 0
    j = i
    while j != 0:
        s += j % 10
        j //= 10
    if a <= s <= b:
        ans += i
print(ans)

-n, a, b = input().split() -n, a, b = int(n), int(a), int(b) -m = len(str(n)) -""" -c=0 -if n==10**4 and A==1: -    c=1 -k=len(str(n)) -for i in range(k): -""" -c = 0 -for i in range(n): -    # map関数はクソ便利 -    if a <= sum(list(map(int, str(i + 1)))) <= b: -        c += i + 1 -print(c) +n, a, b = list(map(int, input().split())) +ans = 0 +for i in range(1, n + 1): +    s = 0 +    j = i +    while j != 0: +        s += j % 10 +        j //= 10 +    if a <= s <= b: +        ans += i +print(ans)