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

    println(
      (1 to n)
      .filter { i =>
        val sum = i.toString.map(_.toString.toInt).sum
        a <= sum && sum <= b
      }
      .sum
    )
  }
}
