
object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val n, a, b = sc.nextInt()
  var  ans = 0
  for (i <- 1 to n) {
    val sum = i.toString.toList.foldLeft(0)((x, y) => x + y.asDigit)
    if (a <= sum && sum <= b) {
      ans += i
    }
  }
  println(ans)
}