import sys

input = sys.stdin.readline

sys.setrecursionlimit(10**7)

from collections import Counter, deque

from collections import defaultdict

from itertools import combinations, permutations, accumulate, groupby, product

from bisect import bisect_left,bisect_right

from heapq import heapify, heappop, heappush

from math import floor, ceil,pi,factorial

from operator import itemgetter

def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))

def LI2(): return [int(eval(input())) for i in range(n)]

def MXI(): return [[LI()]for i in range(n)]

def SI(): return input().rstrip()

def printns(x): print(('\n'.join(x)))

def printni(x): print(('\n'.join(list(map(str,x)))))

inf = 10**17

mod = 10**9 + 7



n=I()

lis1=[];lis2=[]

for i in range(n):

    a,b=MI()

    lis1.append(a)

    lis2.append(b)

lis1.sort()

lis2.sort()

if n%2==1:

    ans=max(0,lis2[(n-1)//2]-lis1[(n-1)//2]+1)

else:

    sup1=lis2[n//2-1]

    sup2=lis2[n//2]

    low1=lis1[n//2-1]

    low2=lis1[n//2]

    ans=(sup1+sup2-low1-low2+1)

    ans=max(ans,0)

print(ans)
#float型を許すな

#numpyはpythonで

import sys

input = sys.stdin.readline

sys.setrecursionlimit(10**7)

from collections import Counter, deque

from collections import defaultdict

from itertools import combinations, permutations, accumulate, groupby, product

from bisect import bisect_left,bisect_right

from heapq import heapify, heappop, heappush

from math import floor, ceil,pi,factorial

from operator import itemgetter

def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))

def LI2(): return [int(eval(input())) for i in range(n)]

def MXI(): return [[LI()]for i in range(n)]

def SI(): return input().rstrip()

def printns(x): print(('\n'.join(x)))

def printni(x): print(('\n'.join(list(map(str,x)))))

inf = 10**17

mod = 10**9 + 7



n=I()

lis1=[]

lis2=[]

for i in range(n):

    a,b=MI()

    lis1.append(a)

    lis2.append(b)

lis1.sort()

lis2.sort()

if n%2==1:

    med1=lis1[n//2]

    med2=lis2[n//2]

    print((med2-med1+1))

if n%2==0:

    med1=lis1[n//2-1]+lis1[n//2]

    med2=lis2[n//2-1]+lis2[n//2]

    print((med2-med1+1))
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left, bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil, pi, factorial
from operator import itemgetter


def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(map(int, input().split()))


def LI2():
    return [int(eval(input())) for i in range(n)]


def MXI():
    return [[LI()] for i in range(n)]


def SI():
    return input().rstrip()


def printns(x):
    print(("\n".join(x)))


def printni(x):
    print(("\n".join(list(map(str, x)))))


inf = 10**17
mod = 10**9 + 7
n = I()
lis1 = []
lis2 = []
for i in range(n):
    a, b = MI()
    lis1.append(a)
    lis2.append(b)
lis1.sort()
lis2.sort()
if n % 2 == 1:
    ans = max(0, lis2[(n - 1) // 2] - lis1[(n - 1) // 2] + 1)
else:
    sup1 = lis2[n // 2 - 1]
    sup2 = lis2[n // 2]
    low1 = lis1[n // 2 - 1]
    low2 = lis1[n // 2]
    ans = sup1 + sup2 - low1 - low2 + 1
    ans = max(ans, 0)
print(ans)

# float型を許すな
# numpyはpythonで
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left, bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil, pi, factorial
from operator import itemgetter


def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(map(int, input().split()))


def LI2():
    return [int(eval(input())) for i in range(n)]


def MXI():
    return [[LI()] for i in range(n)]


def SI():
    return input().rstrip()


def printns(x):
    print(("\n".join(x)))


def printni(x):
    print(("\n".join(list(map(str, x)))))


inf = 10**17
mod = 10**9 + 7
n = I()
lis1 = []
lis2 = []
for i in range(n):
    a, b = MI()
    lis1.append(a)
    lis2.append(b)
lis1.sort()
lis2.sort()
if n % 2 == 1:
    med1 = lis1[n // 2]
    med2 = lis2[n // 2]
    print((med2 - med1 + 1))
if n % 2 == 0:
    med1 = lis1[n // 2 - 1] + lis1[n // 2]
    med2 = lis2[n // 2 - 1] + lis2[n // 2]
    print((med2 - med1 + 1))

+# float型を許すな +# numpyはpythonで -    ans = max(0, lis2[(n - 1) // 2] - lis1[(n - 1) // 2] + 1) -else: -    sup1 = lis2[n // 2 - 1] -    sup2 = lis2[n // 2] -    low1 = lis1[n // 2 - 1] -    low2 = lis1[n // 2] -    ans = sup1 + sup2 - low1 - low2 + 1 -    ans = max(ans, 0) -print(ans) +    med1 = lis1[n // 2] +    med2 = lis2[n // 2] +    print((med2 - med1 + 1)) +if n % 2 == 0: +    med1 = lis1[n // 2 - 1] + lis1[n // 2] +    med2 = lis2[n // 2 - 1] + lis2[n // 2] +    print((med2 - med1 + 1))