func sumDigits(_ num: Int) -> Int {
    var num = num
    var sum = 0
    while num > 0 {
        sum += num%10
        num /= 10
    }
    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] <= sumDigits(i) && sumDigits(i) <= rd[2] {
        sum += sumDigits(i)
    }
}
print(sum)