fun main() {
    val (n,a,b) = readLine()!!.split(" ").map { it.toInt() }
    var total = 0

    for (i in 1..n){
        val check = col(i)
        if (check in a..b){
            total += i
        }
    }

    println(total)
}

fun col(k:Int): Int{
    var result = 0
    var num = k

    while (num!=0){
        result += num%10
        num /= 10
    }

    return result
}