s = input().split()

N = int(s[0])

A = int(s[1])

B = int(s[2])

k = 0

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

  S = 0

  p = str(i)

  q = [str(c) for c in p]

  q = list(map(int,q))

  for j in range(len(q)):

    S = S + q[j]

  if A <= S <= B:

    k = k + i

print(k)

    
s = input().split()

N = int(s[0])

A = int(s[1])

B = int(s[2])

k = 0

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

  S = 0

  l = i

  while l >= 1:

    p = l%10

    l = l//10

    S = S + p

  if A <= S <= B:

    k = k + i

print(k)
s = input().split()
N = int(s[0])
A = int(s[1])
B = int(s[2])
k = 0
for i in range(1, N + 1):
    S = 0
    p = str(i)
    q = [str(c) for c in p]
    q = list(map(int, q))
    for j in range(len(q)):
        S = S + q[j]
    if A <= S <= B:
        k = k + i
print(k)

s = input().split()
N = int(s[0])
A = int(s[1])
B = int(s[2])
k = 0
for i in range(1, N + 1):
    S = 0
    l = i
    while l >= 1:
        p = l % 10
        l = l // 10
        S = S + p
    if A <= S <= B:
        k = k + i
print(k)

-    p = str(i) -    q = [str(c) for c in p] -    q = list(map(int, q)) -    for j in range(len(q)): -        S = S + q[j] +    l = i +    while l >= 1: +        p = l % 10 +        l = l // 10 +        S = S + p