import Control.Applicative
import Control.Monad
import Data.List

main = do
  n <- (read::String -> Int) <$> getLine
  arr <- sort . map (read::String -> Int) . words <$> getLine
  let lb = (arr !! ((n `div` 2) - 1)) + 1
      ub = arr !! (n `div` 2)
  if lb <= ub 
    then print $ ub - lb + 1
    else print 0
  