import Data.List

toInt :: (String -> Int)
toInt x = read x ::Int

main :: IO ()
main = do
    n <- readLn
    di <- getLine
    let
        d = (map $ toInt) $ words di
        sd = sort d

    print $ (sd !! (n `div` 2)) - sd !! (n `div` 2 - 1)
