import Control.Monad
import Data.List

readPair :: IO (Int, Int)
readPair = do
    [a,b] <- map read . words <$> getLine
    return (a,b)

median :: [Int] -> Int
median as
    | odd l = as !! ((l-1)`div`2)
    | even l = undefined
  where
    l = length as
    s = sort as

twiceMedian :: [Int] -> Int
twiceMedian as
    | odd l = 2 * (as !! ((l-1)`div`2))
    | even l = (as !! (l `div` 2 - 1) + as !! (l `div` 2))
  where
    l = length as
    s = sort as

main = do
    n <- readLn
    abs <- replicateM n readPair
    let as = map fst abs
    let bs = map snd abs
    print $ if odd n then median bs - median as + 1
                else twiceMedian bs - twiceMedian as + 1
