'use strict'

function main(input) {

    input = input.split(/\n|\s/).map(v => ~~v)
    const n = input[0]
    const a = input[1]
    const b = input[2]

    let total = 0
    for (let i = 1; i <= n; i++) {

        let tmp = i.toString().split('').map(v => ~~v).reduce((a, b) => a + b)

        if (a <= tmp && tmp <= b) {
            total += i
        }

    }
    console.log(total)

}
main(require("fs").readFileSync("/dev/stdin", "utf8"));