// abc083-b
object Main extends App {
  val Array(n,a,b) = io.StdIn.readLine.split(" ").map(_.toInt)

  def str2digit_sum(str: String): Int = 
    str.map(_.asDigit).sum

  val filtered = (1 to n).filter { i =>
  val sum = str2digit_sum(i.toString)
  a <= sum && sum <= b
  }

  println(filtered.sum)
}