object Main extends App {
  def recursive_sum(i: Int): Int = {
    def accumlator(acc: Int, i: Int): Int = if (i == 0) {
      acc
    } else {
      accumlator(acc + (i % 10), i / 10)
    }

    accumlator(0, i)
  }

  val sc = new java.util.Scanner(System.in)
  val n, a, b = sc.nextInt()
  val xs = for {
    i <- Iterator.range(1, n + 1)
    t = (i, recursive_sum(i))
    if a <= t._2 && t._2 <= b
  } yield {
    t._1
  }
  val ret = xs.sum
  println(ret)
}
