function main(input){
  var _input = input.split(' ')
  var N = parseInt(_input[0]) 
  var min = parseInt(_input[1]) 
  var max = parseInt(_input[2]) 
  compute(N, min, max)
}
function compute(N, min, max){

  var result = 0
  var ranks = [10000, 1000, 100, 10, 0]

  for(var i = 1; i <= N; i++){
    var tTotal = 0
    var invalid = false
    var _i = i
    for(var d = 0; d < ranks.length; d++) {
      var rank = ranks[d]
      var digit = rank !== 0 ? Math.floor(_i / rank) : _i
      tTotal += digit
      if (tTotal > max) {
        invalid = true
        break
      }
      _i-=(rank * digit)
    }
    if(tTotal >= min && !invalid) result += i
  }
  console.log(result)
  
}

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