open System

let [| n; a; b |] =
    stdin.ReadLine().Split(' ') |> Array.map int

let ns = [| 1 .. n |]

ns
|> Array.map
    (string
     >> Seq.map (fun x -> int x - int '0')
     >> Seq.sum)
|> Array.mapi (fun i x -> if (a <= x && x <= b) then ns.[i] else 0)
|> Array.sum
|> printfn "%d"
