let [|N;A;B|] =
    stdin.ReadLine().Split()
    |> Array.map int

[|1..N|]
|> Array.filter (fun x ->
    let sum = x/10000 + x%10000/1000 + x%1000/100 + x%100/10 + x%10
    sum >= A && sum <= B)
|> Array.sum
|> stdout.WriteLine