fun main(args: Array<String>) {
    val nums = readLine()?.split(" ")
    nums ?: return
    val n = nums[0].toInt()
    val a = nums[1].toInt()
    val b = nums[2].toInt()

    val result = (1..n).filter { sum(it) in a..b }.sum()
    println(result)
}

private fun sum(num: Int): Int {
    var sum = num % 10
    var n = num / 10
    while (n >= 1) {
        sum += (n % 10)
        n /= 10
    }
    return sum
}