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

n = []



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

  a = 0

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

    a += int(str(i)[x])

  if a >= A and a <= B:

    n.append(i)

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



ans = 0

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

  a = list(str(i))

  c = 0

  for j in range(len(a)):

    c += int(a[j])

  if A <= c <= B:

    ans += i

print(ans)

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

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

-n = [] +ans = 0 -    a = 0 -    for x in range(len(str(i))): -        a += int(str(i)[x]) -    if a >= A and a <= B: -        n.append(i) -print((sum(n))) +    a = list(str(i)) +    c = 0 +    for j in range(len(a)): +        c += int(a[j]) +    if A <= c <= B: +        ans += i +print(ans)