import java.io.InputStreamReader
import java.io.BufferedReader

fun main(args: Array<String>) {
  val br = BufferedReader(InputStreamReader(System.`in`))

  val(n, a, b) = br.readLine().split(" ").map { it.toInt() }

  tailrec fun rec(acc: Int, i: Int): Int =
    if(i == 0) acc
    else rec(acc + i%10, i/10)

  val ans = (1..n).fold(0) { acc, i ->
    val v = rec(0, i)
    if(v in a..b) acc + i else acc
  }

  println(ans)
}