fun main(args: Array<String>){
    val (n, a, b) = readLine()!!.split(' ').map(String::toInt)
    print((1..n).filter {i -> calc(i) in a..b}.sum())
}

fun calc(a : Int): Int{
    var i = a
    var ret = 0
    while(i != 0){
        ret += i % 10
        i /= 10
    }
    return ret
}