object Main extends App{
val Array(n,a,b) = scala.io.StdIn.readLine.split("\\s").map(_.toInt)

var cnt = 0
for (i<-1 to n){
  val hoge = i.toString.toList.map(_.toString.toInt).sum
//   println(i,hoge)
  if (hoge >= a && hoge <= b) cnt += i
}
println(cnt)
}