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

ans = 0

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

  tmp = n

  i = 4

  s = 0

  while i > -1:

    keta = tmp // (10 ** i)

    tmp -=  keta * (10 ** i)

    s += keta

    i -= 1

  if s >= A and s <= B:

    ans += n

print(ans)



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

ans = 0

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

  s = sum(map(int, list(str(n))))

  if s >= A and s <= B:

    ans += n

print(ans)



N, A, B = list(map(int, input().split()))
ans = 0
for n in range(1, N + 1):
    tmp = n
    i = 4
    s = 0
    while i > -1:
        keta = tmp // (10**i)
        tmp -= keta * (10**i)
        s += keta
        i -= 1
    if s >= A and s <= B:
        ans += n
print(ans)

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

-    tmp = n -    i = 4 -    s = 0 -    while i > -1: -        keta = tmp // (10**i) -        tmp -= keta * (10**i) -        s += keta -        i -= 1 +    s = sum(map(int, list(str(n))))