import java.util.Scanner

object Main extends App {

  val sc = new Scanner(System.in)
  val n = sc.nextInt()
  val a = sc.nextInt()
  val b = sc.nextInt()


  private val res = (1 to n)
    .map(i => (i, i.toString.split("").map(_.toInt).sum))
    .filter { case (_, isum) => isum >= a && isum <= b }.map(_._1).sum

  println(res)


}
