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

func main() {
    let line = readInts()
    let n = line[0]
    let a = line[1]
    let b = line[2]
    
    var ans = 0
    for i in 0...n {
        let x = i.description.reduce(0) { $0 + Int(String($1))! }
        if a <= x && x <= b {
            ans += i
        }
    }
    
    print(ans)
}

main()
