open System

let xs = Console.ReadLine().Split(' ')
        |> Array.map int

let mutable result = 0

for s in [1..xs.[0]] do
    let v = string s
            |> List.ofSeq 
            |> List.map (fun c -> int c - int '0')
            |> List.sum

    if xs.[1] <= v && v <= xs.[2] then
        result <- result + s

Console.WriteLine(
    result
)