[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reada f = stdin.ReadLine().Split() |> Array.map f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

[<EntryPoint>]
let main _ =
    let n = read int
    let bs = reads int
    let cs = List.rev bs

    if n = 2 then
        List.head cs * 2
    else
        List.pairwise cs
        |> List.sumBy (fun (x, y) -> min x y)
        |> fun x -> x + List.head cs + List.head bs
    |> printfn "%i"
    0