object Main extends App {
  val Array(n, a, b) = readLine.split(" ").map(_.toInt)
  
  val elements = for {
    e <- (0 to n).toList
    str = e.toString.split("").filter(_.nonEmpty)
    sum = str.map(_.toInt).sum
    if a <= sum
    if sum <= b
  } yield e
  
  println(elements.sum)
}