fun main(args: Array<String>) {
    val (n, a,b) = readLine()!!.split(" ").map{i -> i.toInt()}
    var sum = 0
    var ans = 0


    for ( i in 1..n){
        var s = i.toString().split("").filter {it.isNotEmpty()}.map{i -> i.toInt()}

        for( j in 0..s.size-1){
            sum += s[j]

        }
        if( sum >= a && sum <= b) ans += i
        sum = 0
    }
    println(ans)

}