import Data.List

main :: IO ()
main = do
    n <- readLn :: IO Int
    ds <- map read . words <$> getLine :: IO [Int]
    print $ solve n ds

solve n ds =
    y - x
    where
        sorted = sort ds
        x = sorted !! (n `div` 2 - 1)
        y = sorted !! (n `div` 2)