fun main(args: Array<String>) {
    val (n, a, b) = readLine()!!.split(" ").subList(0, 3).map { it.toInt() }
    var total = 0
    for (x in 1..n) {
        val s = x.toString().map(Character::getNumericValue).sum()
        if (s in a..b)   {
            total += x
        }
    }
    print(total)
}
