object Main extends App {
  val arr = scala.io.StdIn.readLine().split(" ").map(_.toInt)
  val (n, a, b) = (arr(0), arr(1), arr(2))

  var ls = scala.collection.mutable.ArrayBuffer.empty[Int]
  for (e <- 0 to n) e match {
    case x if x < 10 && (a to b).contains(x) => ls += x
    case x if x >= 10 && (a to b).contains(x.toString.map(_.asDigit).sum) => ls += x
    case _ => None
  }

  val ans = ls.sum

  println(ans)
}