main = do
  li <- getLine
  let n = read li
  li <- getLine
  let bs = map read $ words li
  let ans = compute n bs
  print ans

-- aiはmin b(i-1) bi以下なので、その総和をとる

compute :: Int -> [Int] -> Int
compute _ bs = sum $ zipWith min bs1 (tail bs1)
  where
    bs1 = head bs : bs ++ [last bs]