function main(arg) {
  var items = arg.trim().split(' ').map(item => parseInt(item));
  var count = 0;
  for (var i = 0; i <= items[0]; i++) {
    if (isOK(i, items[1], items[2])) {
      count += i;
    }
  }
  console.log(count);
}

function isOK(num, min, max) {
  let nums = num.toString().split('').map(i => parseInt(i));
  let total = 0;
  for (let i = 0; i < nums.length; i++) {
    total += nums[i];
  }
  return total <= max && total >= min;
}

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