import scala.io.StdIn

object Main {
  def main(args: Array[String]) = {
    val array = StdIn.readLine.split(" ").map(_.toInt)
    val (n, a, b) = (array(0), array(1), array(2))
    var count = 0
   
    for(x <- 1 to array(0)){
      if((a to b).contains(x.toString.map(_.asDigit).sum)) count += x 
    }
    println(count)
  }
  
}