import scala.io.StdIn

object Main extends App {

  val line = StdIn.readLine().split(" ").map(_.toInt).toList
  var result: Int = 0
  for (i <- 1 to line.head) {
    val sum = i.toString.split("").toList.map(_.toInt).sum
    if(sum >= line(1) && sum <= line(2)) result += i
  }
  println(result)

}