function Main(input) {
  const arr = input.split(' ').map(x => Number(x));
  var total = 0;

  for (var i = 1; i <= arr[0]; i++) {
    var sum = Array.from(String(i)).map(x => Number(x)).reduce((a,c) => a + c);
    if (arr[1] <= sum && sum <= arr[2]) {
      console.log(sum, i);
      total += i;
    }
  }

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