N = int(eval(input()))

ab = []

for i in range(N):

    ab.append(tuple(map(int,input().split())))

 

up = sorted(ab,key=lambda a:a[1],reverse=True)

down = sorted(ab,key=lambda a:a[0],reverse=True)

 

if N%2 == 1:

    print((up[N//2][1]-down[N//2][0]+1))

else:

    up2 = sorted(ab,key=lambda a:a[1],reverse=False)

    down2 = sorted(ab,key=lambda a:a[0],reverse=False)

    r = (up[N//2][1]+up2[N//2][1])

    l = (down[N//2][0]+down2[N//2][0])

    print((r-l+1))
N = int(eval(input()))

ab = []

for i in range(N):

    ab.append(tuple(map(int,input().split())))

 

up = sorted(ab,key=lambda a:a[1],reverse=True)

down = sorted(ab,key=lambda a:a[0],reverse=True)

 

if N%2 == 1:

    print((up[N//2][1]-down[N//2][0]+1))

else:

    r = (up[N//2][1]+up[N//2-1][1])

    l = (down[N//2][0]+down[N//2-1][0])

    print((r-l+1))
N = int(eval(input()))
ab = []
for i in range(N):
    ab.append(tuple(map(int, input().split())))
up = sorted(ab, key=lambda a: a[1], reverse=True)
down = sorted(ab, key=lambda a: a[0], reverse=True)
if N % 2 == 1:
    print((up[N // 2][1] - down[N // 2][0] + 1))
else:
    up2 = sorted(ab, key=lambda a: a[1], reverse=False)
    down2 = sorted(ab, key=lambda a: a[0], reverse=False)
    r = up[N // 2][1] + up2[N // 2][1]
    l = down[N // 2][0] + down2[N // 2][0]
    print((r - l + 1))

N = int(eval(input()))
ab = []
for i in range(N):
    ab.append(tuple(map(int, input().split())))
up = sorted(ab, key=lambda a: a[1], reverse=True)
down = sorted(ab, key=lambda a: a[0], reverse=True)
if N % 2 == 1:
    print((up[N // 2][1] - down[N // 2][0] + 1))
else:
    r = up[N // 2][1] + up[N // 2 - 1][1]
    l = down[N // 2][0] + down[N // 2 - 1][0]
    print((r - l + 1))

-    up2 = sorted(ab, key=lambda a: a[1], reverse=False) -    down2 = sorted(ab, key=lambda a: a[0], reverse=False) -    r = up[N // 2][1] + up2[N // 2][1] -    l = down[N // 2][0] + down2[N // 2][0] +    r = up[N // 2][1] + up[N // 2 - 1][1] +    l = down[N // 2][0] + down[N // 2 - 1][0]