object Main{
  def main(args: Array[String]) {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val a, b = sc.nextInt

    val total = (1 to n).map { i =>
      var d = i
      var sumOfDigits = 0
      while (d > 0) {
        sumOfDigits += d % 10
        d /= 10
      }
      if (a <= sumOfDigits && sumOfDigits <= b) i
      else 0
    }.foldLeft(0){ (acc, x) => acc + x }

    println(total)
  }
}