function Main(input) {
    var n = input.split(" ")[0];
    var a = input.split(" ")[1];
    var b = input.split(" ")[2];
    var answer = 0;

    for(var i = 1; i <= n; i++ ) {
        var v = Math.floor(i/10000);
        var w = Math.floor(i/1000);
        var x = Math.floor(i/100);
        var y = Math.floor(i/10);
        var z = i % 10;

        if (v + w + x + y + z >= a && v + w + x + y + z <= b) {
            answer = answer + 10000*v + 1000*w + 100*x + 10*y + z;
        }
    }

    console.log(answer)
  
    }
  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
  