object Main extends App {
  val Array(n, a, b) = io.StdIn.readLine().split(" ").map(_.toInt)
  def convert(i: Int): Int = {
    val x = i.toString.toSeq.map(s => s.toString.toInt).sum
    if (x >= a && x <= b) i else 0
  }
  val res = Seq.range(1, n + 1).map(convert).sum
  println(res)
}