import Data.List
import Data.Char (isSpace)
import qualified Data.ByteString.Char8 as BS

main = do
  n <- readLn :: IO Int
  b <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
  -- b_i >= max a_i a_{i+1}
  -- a_i についての条件：
  -- - b_i >= a_i     (1 <= i <= n-1)
  -- - b_{i-1} >= a_i (2 <= i <= n)
  -- 言い換えると
  -- - min b_i b_{i-1} >= a_i  (2 <= i <= n-1)
  -- a_1 := b_1
  -- a_i := min b_i b_{i-1}  (2 <= i <= n-1)
  -- a_n := b_n

  print $ head b + sum (zipWith min b (tail b)) + last b
