import Foundation
func indexSum(_ num: Int) -> Int {
    var sum = 0
    var arr = Array(String(num))
    for i in 0 ..< arr.count {
        var k = Int(String(arr[i]))
        sum += k ?? 0
    }
    return sum
}
let rd = readLine()!.split(separator: " ").map({Int($0)!})
let N = rd[0]
var sum = 0

for i in 1 ... N {
    if rd[1] <= indexSum(i) && indexSum(i) <= rd[2] {
        sum += i
    }
}
print(sum)