object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, a, b = sc.nextInt

  var sum = 0
  for(i <- 0 to n) {
    val s = i.toString.toList
    val tmp = s.map(_.asDigit).sum
    if(tmp >= a && tmp <= b) sum += i
  }
  println(sum)
}