N,A,B=[int(x) for x in input().split()]

res=0

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

  t=sum([int(x) for x in list(str(i))])

  if t>=A and t<=B:

    res+=i

print(res)
N,A,B=[int(x) for x in input().split()]

res=0

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

  t=sum([int(x) for x in list(str(i))])

  if A<=t<=B:

    res+=i

print(res)
N, A, B = [int(x) for x in input().split()]
res = 0
for i in range(1, N + 1):
    t = sum([int(x) for x in list(str(i))])
    if t >= A and t <= B:
        res += i
print(res)

N, A, B = [int(x) for x in input().split()]
res = 0
for i in range(1, N + 1):
    t = sum([int(x) for x in list(str(i))])
    if A <= t <= B:
        res += i
print(res)

-    if t >= A and t <= B: +    if A <= t <= B: