import io.StdIn.readLine

object Main extends App {
  val in = readLine().split(" ").map(_.toInt).toList

  def loop(list: List[Int], total: Int = 0): Int = list match {
    case head :: Nil  =>
      val sum = digitTotal(head)
      if(sum >= in(1) && sum <= in(2)) total + head else total
    case head :: tail =>
      val sum = digitTotal(head)
      loop(tail, if(sum >= in(1) && sum <= in(2)) total + head else total)
  }

  def digitTotal(num: Int): Int = num.toString.split("").map(_.toInt).sum

  println(loop((1 to in(0)).toList))
}
