import scala.io.StdIn
object Main extends App {
  def digitSum(n: Int): Int = {
    def _digitSum(n: Int, sum: Int): Int = {
      if (n == 0) sum else _digitSum(n / 10, sum + (n % 10))
    }
    _digitSum(n,0)
  }
  val input = StdIn.readLine()
  val N = input.split(" ")(0).toInt
  val A = input.split(" ")(1).toInt
  val B = input.split(" ")(2).toInt
  val answer = (for {
    n <- 1 to N
    sum = digitSum(n)
    if (A <= sum && sum <= B)
  } yield n).sum
  println(answer)
}
