open System
let readIntArray () = stdin.ReadLine().Split(' ') |> Array.map int

let [| N; A; B |] = readIntArray ()

let digSum n = 
    n
    |> string
    |> Seq.sumBy(fun c -> int c - int '0') //char to int
   
[1..N]
|> Seq.sumBy (fun v -> if (digSum v >= A) && (digSum v <= B) then v else 0)
|> printfn "%d"