function main(input) {
    const [N, A, B] = input.split(' ').map( n => parseInt(n, 10) );

    const nums = Array.from(new Array(N), (v, i) => ++i ).filter( (i) => {
        let n = i.toString().split('').reduce( (p, c) => p + parseInt(c, 10), 0 );
        return (n >= A && n <= B );
    })

    console.log( nums.reduce( (p, c) => p + c, 0 ) );
}

main( require('fs').readFileSync('/dev/stdin', 'utf8') )