object Main extends App {

  val Array(n, a, b) = io.StdIn.readLine.split(" ").map(_.toInt)

  val ans = (1 to n).par.foldLeft(0)( (acc,i) => {
      val sum = String.valueOf(i).map(_.asDigit).sum
      if(a <= sum && sum <= b ) acc + i else acc
    })

  println(ans)
}