n = list(map(int, input().split()))



total = 0

for i in range(1, n[0]+1):

    sum = 0

    number = str(i)

    for k in range(len(number)):

        sum += int(number[k])

    if n[1] <= sum <= n[2]:

        total += i

print(total)

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



ans = 0

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

  s = 0

  N = n

  while n>0:

    s += n%10

    n //= 10

  if A <= s <= B:

    ans += N

print(ans)
n = list(map(int, input().split()))
total = 0
for i in range(1, n[0] + 1):
    sum = 0
    number = str(i)
    for k in range(len(number)):
        sum += int(number[k])
    if n[1] <= sum <= n[2]:
        total += i
print(total)

N, A, B = list(map(int, input().split()))
ans = 0
for n in range(1, N + 1):
    s = 0
    N = n
    while n > 0:
        s += n % 10
        n //= 10
    if A <= s <= B:
        ans += N
print(ans)

-n = list(map(int, input().split())) -total = 0 -for i in range(1, n[0] + 1): -    sum = 0 -    number = str(i) -    for k in range(len(number)): -        sum += int(number[k]) -    if n[1] <= sum <= n[2]: -        total += i -print(total) +N, A, B = list(map(int, input().split())) +ans = 0 +for n in range(1, N + 1): +    s = 0 +    N = n +    while n > 0: +        s += n % 10 +        n //= 10 +    if A <= s <= B: +        ans += N +print(ans)