import Data.List
import Data.Char
import Data.Maybe
import qualified Data.ByteString.Char8 as BS8

--sol :: [a] -> a
sol a
    | length a == 1 = head a
    | otherwise = sol (aws ++ [(mina + sma) / 2])
    where
        mina = minimum a
        awm = if length [x | x <- a, x == mina] == 1
            then [x | x <- a, x /= mina]
            else [x | x <- a, x /= mina] ++ replicate (length a - length [x | x <- a, x /= mina] - 1) mina
        sma = if length [x | x <- a, x == mina] == 1
            then minimum awm
            else mina
        aws = if length [x | x <- awm, x /= sma] == 1
            then [x | x <- awm, x /= sma]
            else [x | x <- awm, x /= sma] ++ replicate (length awm - length [x | x <- awm, x /= sma] - 1) sma

main :: IO ()
main = do
    n <- fst . fromJust . BS8.readInteger <$> BS8.getLine
    vb <- unfoldr (BS8.readInteger . BS8.dropWhile isSpace) <$> BS8.getLine
    let v = [toRational x | x <- vb]

    print $ fromRational $ sol v
