func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

extension Int {
    var digits: [Int] {
        String(describing: self).compactMap { Int(String($0))! }
    }
}

func main() {
  let numbers: [Int] = readInts()
  var sum = 0
  for i in 1...numbers.first! {
    let sumOfDigits = i.digits.reduce(0) { $0 + $1 }
    if sumOfDigits >= numbers[1] && sumOfDigits <= numbers[2] {
      sum += i
    }
  }
  print(sum)
}

main()