import Control.Monad
import Data.List(sort)

read_ :: String -> Int
read_ = read


main = do
 str <- getLine
 let n = read_ str
 when (n>0) $ do
  arr <- sequence $ replicate n getLine
  let a = tail . init . sort . map read $ arr
  print $ sum a `div` length a
  main