N = int(eval(input()))

A = [None] * N

B = [None] * N

for i in range(N):

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

    A[i] = a

    B[i] = b



A.sort()

B.sort()



if N % 2 == 0:

    b = (B[N // 2] + B[(N - 1) // 2]) / 2

    a = (A[N // 2] + A[(N - 1) // 2]) / 2

    print((int((b - a) * 2 + 1)))

else:

    print((B[N // 2] - A[N // 2] + 1))

from sys import stdin

readline = stdin.readline



N = int(readline())

A = [None] * N

B = [None] * N

for i in range(N):

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

    A[i] = a

    B[i] = b



A.sort()

B.sort()



if N % 2 == 0:

    b = (B[N // 2] + B[(N - 1) // 2]) / 2

    a = (A[N // 2] + A[(N - 1) // 2]) / 2

    print((int((b - a) * 2 + 1)))

else:

    print((B[N // 2] - A[N // 2] + 1))

N = int(eval(input()))
A = [None] * N
B = [None] * N
for i in range(N):
    a, b = list(map(int, input().split()))
    A[i] = a
    B[i] = b
A.sort()
B.sort()
if N % 2 == 0:
    b = (B[N // 2] + B[(N - 1) // 2]) / 2
    a = (A[N // 2] + A[(N - 1) // 2]) / 2
    print((int((b - a) * 2 + 1)))
else:
    print((B[N // 2] - A[N // 2] + 1))

from sys import stdin

readline = stdin.readline
N = int(readline())
A = [None] * N
B = [None] * N
for i in range(N):
    a, b = list(map(int, readline().split()))
    A[i] = a
    B[i] = b
A.sort()
B.sort()
if N % 2 == 0:
    b = (B[N // 2] + B[(N - 1) // 2]) / 2
    a = (A[N // 2] + A[(N - 1) // 2]) / 2
    print((int((b - a) * 2 + 1)))
else:
    print((B[N // 2] - A[N // 2] + 1))

-N = int(eval(input())) +from sys import stdin + +readline = stdin.readline +N = int(readline()) -    a, b = list(map(int, input().split())) +    a, b = list(map(int, readline().split()))