n=int(eval(input()))



s=[]

e=[]

for i in range(n):

  a,b=list(map(int,input().split()))

  s.append(a)

  e.append(b)



s=sorted(s)

e=sorted(e,reverse=True)



x=n//2

if n%2==1:

  ans=(e[x]-s[x]+1)



else:

  ts=(s[x]+s[x-1])/2

  te=(e[x]+e[x-1])/2

  ans=(te-ts)//0.5+1



print((int(ans)))
from sys import stdin

nii=lambda:list(map(int,stdin.readline().split()))

lnii=lambda:list(map(int,stdin.readline().split()))



n=int(eval(input()))

l1=[]

l2=[]

for i in range(n):

  a,b=nii()

  l1.append(a)

  l2.append(b)



l1.sort()

l2.sort()



if n%2==1:

  ans=l2[n//2]-l1[n//2]

else:

  m1=(l2[n//2]+l2[n//2-1])

  m2=(l1[n//2]+l1[n//2-1])

  ans=m1-m2



print((ans+1))
n = int(eval(input()))
s = []
e = []
for i in range(n):
    a, b = list(map(int, input().split()))
    s.append(a)
    e.append(b)
s = sorted(s)
e = sorted(e, reverse=True)
x = n // 2
if n % 2 == 1:
    ans = e[x] - s[x] + 1
else:
    ts = (s[x] + s[x - 1]) / 2
    te = (e[x] + e[x - 1]) / 2
    ans = (te - ts) // 0.5 + 1
print((int(ans)))

from sys import stdin

nii = lambda: list(map(int, stdin.readline().split()))
lnii = lambda: list(map(int, stdin.readline().split()))
n = int(eval(input()))
l1 = []
l2 = []
for i in range(n):
    a, b = nii()
    l1.append(a)
    l2.append(b)
l1.sort()
l2.sort()
if n % 2 == 1:
    ans = l2[n // 2] - l1[n // 2]
else:
    m1 = l2[n // 2] + l2[n // 2 - 1]
    m2 = l1[n // 2] + l1[n // 2 - 1]
    ans = m1 - m2
print((ans + 1))

+from sys import stdin + +nii = lambda: list(map(int, stdin.readline().split())) +lnii = lambda: list(map(int, stdin.readline().split())) -s = [] -e = [] +l1 = [] +l2 = [] -    a, b = list(map(int, input().split())) -    s.append(a) -    e.append(b) -s = sorted(s) -e = sorted(e, reverse=True) -x = n // 2 +    a, b = nii() +    l1.append(a) +    l2.append(b) +l1.sort() +l2.sort() -    ans = e[x] - s[x] + 1 +    ans = l2[n // 2] - l1[n // 2] -    ts = (s[x] + s[x - 1]) / 2 -    te = (e[x] + e[x - 1]) / 2 -    ans = (te - ts) // 0.5 + 1 -print((int(ans))) +    m1 = l2[n // 2] + l2[n // 2 - 1] +    m2 = l1[n // 2] + l1[n // 2 - 1] +    ans = m1 - m2 +print((ans + 1))