object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val c = IndexedSeq.fill(n)((sc.nextInt(), sc.nextInt()))
  val a = c.map(_._1).sorted
  val b = c.map(_._2).sorted

  val amed = if (n % 2 == 1) a((n-1)/2) else a(n/2 - 1) + a(n/2)
  val bmed = if (n % 2 == 1) b((n-1)/2) else b(n/2 - 1) + b(n/2)
  println(bmed - amed + 1)
}