open System

let inp = stdin.ReadLine().Split(' ') |> Array.map int
let N,A,B = (inp.[0],inp.[1],inp.[2])

let mutable ans = 0

let rec sum x = 
    if x = 0 then 0
    else (x%10) + (sum (x/10))

for i in 1..N do
    if (let s = sum i in (A <= s && s <= B)) then
        ans <- ans + i

printfn "%d" ans
