output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1 B_1
      A_2 B_2
      :
      A_N B_N
attempt: import numpy as np
  
  N = int(input())
  AB = np.array([list(map(int, input().split())) for i in range(N)])
  AB_T = AB.T
  A = AB_T[0].tolist()
  B = AB_T[1].tolist()
  if N == 2:
      X_1 = min(A)
      Y_1 = max(B)
      A.remove(min(A))
      B.remove(max(B))
      X_2 = min(A)
      Y_2 = max(B)
      X = X_2 - X_1
      Y = Y_1 - Y_2 + 1
      print(X + Y)
  elif N % 2 == 0:
      for i in range(int(N // 2)):
          A.remove(min(A))
          B.remove(max(B))
          if i == int(N // 2) - 1:
              X_1 = min(A)
              Y_1 = max(B)
              A.remove(min(A))
              B.remove(max(B))
              X_2 = min(A)
              Y_2 = max(B)
              X = X_2 - X_1
              Y = Y_1 - Y_2 + 1
              print(X + Y)
              break
  else:
      for i in range(int((N + 1) // 2) - 1):
          A.remove(min(A))
          B.remove(max(B))
          if i == int((N + 1) // 2) - 2:
              L_1 = min(A)
              M_1 = max(B)
              A.remove(min(A))
              B.remove(max(B))
              L_2 = min(A)
              M_2 = max(B)
              L = L_2 - L_1
              M = M_1 - M_2 + 1
              print(L + M)
              break
  
problem_description: Statement
  
  There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq
  B_i. Find the number of different values that the median of X_1, X_2, \cdots,
  X_N can take.
samples: [{"input": "2\n    1 2\n    2 3", "output": "3\n    \n\n  * If X_1 = 1 and X_2 = 2, the median is \\frac{3}{2};\n\n  * if X_1 = 1 and X_2 = 3, the median is 2;\n\n  * if X_1 = 2 and X_2 = 2, the median is 2;\n\n  * if X_1 = 2 and X_2 = 3, the median is \\frac{5}{2}.\n\nThus, the median can take three values: \\frac{3}{2}, 2, and \\frac{5}{2}.\n\n* * *"}, {"input": "3\n    100 100\n    10 10000\n    1 1000000000", "output": "9991"}]