fun main(args: Array<String>) {
    val (N, A, B) = kotlin.io.readLine()!!.split(" ").map(String::toInt)


    val a = (1..N).filter {
        sumOfDigits(it) in A..B
    }
    println(a.sum())
}

fun sumOfDigits(n0: Int): Int {
    var n = n0
    var result = 0
    while (n != 0) {
        result += n % 10
        n /= 10
    }
    return result
}