import scala.io.StdIn._
object Main extends App {
  val n = readInt()
  var a, b = new Array[Int](n)
  for (i <- Range(0, n)) {
    val k = readLine().split(" ").map(_.toInt)
    a(i) = k(0)
    b(i) = k(1)
  }
  a = a.sorted
  b = 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)
  }
}
