let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.map f
let n = (read int) - 1
let bs' = reads int
let as' = Array.append [| Array.head bs' |] bs'
for i = 0 to n-1 do
    if bs'.[i] < max as'.[i] as'.[i+1] then
        as'.[i] <- bs'.[i]
        as'.[i+1] <- bs'.[i]
printfn "%A" (Array.sum as')