[N, A, B] = input().split()

SUM = 0

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

  list_i = list(str(i))

  sum_i = sum(list(map(int, list_i)))

  if int(A) <= sum_i <= int(B):

    SUM += i

  else:

    continue

print(SUM)
# 10で割っていくやつ

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

sum = 0

a = 0

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

  n = i

  while n > 0:

    a += n % 10

    n //= 10

  if A <= a <= B:

    sum += i

    a = 0

  else:

    a = 0

    continue

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

# 10で割っていくやつ
[N, A, B] = list(map(int, input().split()))
sum = 0
a = 0
for i in range(1, N + 1):
    n = i
    while n > 0:
        a += n % 10
        n //= 10
    if A <= a <= B:
        sum += i
        a = 0
    else:
        a = 0
        continue
print(sum)

-[N, A, B] = input().split() -SUM = 0 -for i in range(1, int(N) + 1): -    list_i = list(str(i)) -    sum_i = sum(list(map(int, list_i))) -    if int(A) <= sum_i <= int(B): -        SUM += i +# 10で割っていくやつ +[N, A, B] = list(map(int, input().split())) +sum = 0 +a = 0 +for i in range(1, N + 1): +    n = i +    while n > 0: +        a += n % 10 +        n //= 10 +    if A <= a <= B: +        sum += i +        a = 0 +        a = 0 -print(SUM) +print(sum)