import Data.List
import Control.Monad
import qualified Data.Vector.Unboxed as V
import qualified Data.ByteString.Char8 as BS

getIntList :: IO [Int]
getIntList = unfoldr (BS.readInt . BS.dropWhile (== ' ')) <$> BS.getLine

mod' :: Integral a => a -> a
mod' n = if n < 1000000007 then n else n `mod` 1000000007

f :: [Int] -> Int
f (b:b':bs)= (min b b') + (f (b':bs))
f _ = 0

main :: IO ()
main = do
  n <- readLn :: IO Int
  bs <- getIntList
  print $ (head bs) + (f bs) + (last bs)
