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

s = 0



for n in range(N + 1):

  d_sum = 0

  for d in str(n):

    d_sum += int(d)

  if d_sum >= A and d_sum <= B:

    s += n

    

print(s)

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

s = 0



for n in range(N+1):

  if A <= sum([int(i) for i in str(n)]) <= B:

    s += n

    

print(s)
N, A, B = list(map(int, input().split()))
s = 0
for n in range(N + 1):
    d_sum = 0
    for d in str(n):
        d_sum += int(d)
    if d_sum >= A and d_sum <= B:
        s += n
print(s)

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

-    d_sum = 0 -    for d in str(n): -        d_sum += int(d) -    if d_sum >= A and d_sum <= B: +    if A <= sum([int(i) for i in str(n)]) <= B: