fun main(args : Array<String>){
    val (N,A,B) = readLine()?.split(" ")?.map(String::toInt)?: return
    var sum = 0

    for( i in 1..N ){
        var sample = i
        var digitSum = 0
        do{
            digitSum += sample % 10
            sample /= 10
        }while(sample > 0)

        if(digitSum in A..B){
            sum += i
        }
    }

    print(sum)
}