func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let ints = readInts()
    let n = ints[0]
    let a = ints[1]
    let b = ints[2]
   
    var total = 0
    for i in 1...n {
        let x = String(i).map { (c) -> Int in
            Int(String(c))!
        }.reduce(0) { (sum, item) -> Int in
            sum + item
        }
        if a <= x && x <= b {
            total += i
        }
    }
    
    print("\(total)")
}

main()
