import Data.Bits
import Data.List
import Control.Monad
import qualified Data.Vector.Unboxed as V
import Control.Monad.ST
import Data.Maybe (fromMaybe)
import qualified Data.ByteString.Lazy.Char8 as B
import Debug.Trace

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

  putStrLn $ show $ (ds !! ((n `div` 2))) - (ds !! ((n `div` 2) - 1))
