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

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    _ <- getLine
    vs <- map fromIntegral <$> getIntList
    print $ solve vs

solve [v] = v
solve vs = solve (((v1 + v2) / 2) : vs')
   where (v1 : v2 : vs') = sort vs