import qualified Data.ByteString.Char8 as C
import Prelude hiding (head, tail, unfoldr)
import Data.Vector.Unboxed
import Data.Vector.Algorithms.Intro

main = C.interact $ C.pack . show . sol . get

get = unfoldr (C.readInt . C.dropWhile (<'0'))

sol v = med b - med a + 1
  where
  n = head v
  a = ifilter (const . even) (tail v)
  b = ifilter (const . odd) (tail v)
  h = n `div` 2
  med w
    | odd n     = u!h
    | otherwise = u!h + u!(h-1)
    where
    u = modify (flip partialSort (h+1)) w