def main():

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

  cnt = 0

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

    if a <= sum(map(int, list(str(i)))) <= b:

      cnt += i

  print(cnt)

  

if __name__ == '__main__':

  main()
def main():

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

  cnt = 0

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

    if a <= i//10000 + (i//1000)%10 + (i//100)%10 + (i//10)%10 + i%10<= b:

      cnt += i

  print(cnt)

  

if __name__ == '__main__':

  main()
def main():
    n, a, b = list(map(int, input().split()))
    cnt = 0
    for i in range(1, n + 1):
        if a <= sum(map(int, list(str(i)))) <= b:
            cnt += i
    print(cnt)


if __name__ == "__main__":
    main()

def main():
    n, a, b = list(map(int, input().split()))
    cnt = 0
    for i in range(1, n + 1):
        if (
            a
            <= i // 10000 + (i // 1000) % 10 + (i // 100) % 10 + (i // 10) % 10 + i % 10
            <= b
        ):
            cnt += i
    print(cnt)


if __name__ == "__main__":
    main()

-        if a <= sum(map(int, list(str(i)))) <= b: +        if ( +            a +            <= i // 10000 + (i // 1000) % 10 + (i // 100) % 10 + (i // 10) % 10 + i % 10 +            <= b +        ):