process.stdin.resume();
process.stdin.setEncoding('utf8');
 
var lines = [];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
reader.on('line', (line) => {
    // ここで入力を処理する
    lines.push(line);
});
var sub_fn = (ary)=>{
  
}
reader.on('close', () => {
  var x = 1*lines[0].split(' ')[0]
  var min = 1*lines[0].split(' ')[1]
  var max = 1*lines[0].split(' ')[2]
  var a_ary = [];
  for (i = 1; i <= x; i++){
    var n = 0;
    var n_ary = (" " + i).split("")
    for(var j in n_ary){
      n += 1*n_ary[j]
    }
    if(n >= min && n <= max){
      a_ary.push(i)
    }
  }
 // console.log(a_ary)
  var ans = 0;
  for(var k in a_ary){
    ans += a_ary[k]
  }


  console.log(ans)
});