open System

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

[| 1 .. n |]
|> Array.map
    (string
     >> Seq.map (fun x -> int x - int '0')
     >> Seq.sum)
|> Array.filter (fun x -> a <= x && x <= b)
|> Array.sum
|> printfn "%d"