import           Data.List


main :: IO ()
main = do
    _  <- read <$> getLine :: IO Int
    ns <- map read . words <$> getLine :: IO [Int]
    let sorted = sort ns
    let a   = sorted !! (length sorted `div` 2)
        b   = sorted !! ((length sorted `div` 2) - 1)
        ans = a - b
    print ans
