import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val n = sc.nextInt()
  val a = new Array[Int](n)
  val b = new Array[Int](n)
  for (i <- Range(0, n)) {
    a(i) = sc.nextInt()
    b(i) = sc.nextInt()
  }
  a.sorted
  b.sorted
  if (n % 2 == 1) {
    println(b(n / 2) - a(n / 2) + 1)
  } else {
    println(b(n / 2) + b(n / 2 - 1) - a(n / 2) - a(n / 2 - 1) + 1)
  }
}
