import           Control.Monad
import qualified Data.ByteString.Char8 as BS
import           Data.List
import           Data.Maybe

readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words

getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

solve :: Integer -> [Integer] -> Integer
solve n p = sum (take (fromInteger n) t) - h
  where
    h = head p
    t = concatMap (replicate 2) p

main = do
  n  <- getInt
  p <- getIntList
  let p' = sortBy (flip compare) p
  print $ solve n p'
