function Main(input) {
    var input  = input.split(' ');
    var n = input[0];
    var a = input[1];
    var b = input[2];
    var Sum = 0;
    for (j = 1; j <= n; j++) {
        var str = j.toString();
        var arr = str.split('').map(n => parseInt(n));
        var x = arr.reduce((a, b) => a + b);
        if(a <= x && x <= b) {
            Sum += j;
        }
    }
    console.log(Sum);
    }
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));