N = int(eval(input()))

A = []

B = []

for i in range(N):

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

    A.append(a)

    B.append(b)

A.sort()

B.sort()



if N%2:

    ma = A[N//2]

    mb = B[N//2]

    print((max(0, mb - ma + 1)))

else:

    ma = A[N//2] + A[N//2-1]

    mb = B[N//2] + B[N//2-1]

    print((max(0, mb - ma + 1)))
import sys

input = sys.stdin.readline

N = int(eval(input()))

AB = [tuple(map(int,input().split())) for i in range(N)]

A = []

B = []

for a,b in AB:

    A.append(a)

    B.append(b)

A.sort()

B.sort()



if N%2==0:

    m = N//2

    b = B[m] + B[m-1]

    a = A[m] + A[m-1]

    print((b - a + 1))

else:

    m = N//2

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

import sys

input = sys.stdin.readline
N = int(eval(input()))
AB = [tuple(map(int, input().split())) for i in range(N)]
A = []
B = []
for a, b in AB:
    A.append(a)
    B.append(b)
A.sort()
B.sort()
if N % 2 == 0:
    m = N // 2
    b = B[m] + B[m - 1]
    a = A[m] + A[m - 1]
    print((b - a + 1))
else:
    m = N // 2
    print((B[m] - A[m] + 1))

+import sys + +input = sys.stdin.readline +AB = [tuple(map(int, input().split())) for i in range(N)] -for i in range(N): -    a, b = list(map(int, input().split())) +for a, b in AB: -if N % 2: -    ma = A[N // 2] -    mb = B[N // 2] -    print((max(0, mb - ma + 1))) +if N % 2 == 0: +    m = N // 2 +    b = B[m] + B[m - 1] +    a = A[m] + A[m - 1] +    print((b - a + 1)) -    ma = A[N // 2] + A[N // 2 - 1] -    mb = B[N // 2] + B[N // 2 - 1] -    print((max(0, mb - ma + 1))) +    m = N // 2 +    print((B[m] - A[m] + 1))