import           Data.List                      ( sort )

main :: IO ()
main = do
    n <- read <$> getLine :: IO Int
    ds <- sort.map read.words <$> getLine :: IO [Int]
    let l = length ds `div` 2
    print $ head(drop l ds) - last(take l ds)
