fun main(args: Array<String>) {
    val (n, a, b) = readInputLine().split(" ").map { it.toInt() }
    
    var ans = 0
    
    for (i in 1..n) {
        var tmp = i
        var sums = 0
        while (tmp != 0) {
            sums += tmp % 10
            tmp /= 10
        }
        if (a <= sums && sums <= b) {
            ans += i
        }
    }
    
    println(ans)
}
 
fun readInputLine(): String {
    return readLine()!!
}
