fun main(args: Array<String>) {
    val (n, a, b) = readLine()!!.split(" ").map(String::toInt)
    var num = 0
    for(i in 1..n) {
        val iStr = i.toString()
        var sum = 0
        for(j in 0..iStr.length -1) {
            val iInt = iStr[j].toString().toInt()
            sum = sum + iInt
        }
        if(sum >= a && sum <= b) {
            num += i
        }
    }
    println(num)
}