object Main extends App {

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

  val ans = (1 to n).foldLeft(0)( (acc,i) => {

    val sum = {
      var m = i
      var t = 0
      for(j <- 1 to 5 if m > 0 ) {
        t += m % 10
        m /= 10
      }
      t
    }

    if(a <= sum && sum <= b ) acc + i else acc
  })

  println(ans)
}