fun main() = Thread(null, ::abc169e, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun abc169e() {
    val n = readLine()!!.toInt()
    val abList = Array(n) {
        val (a, b) = readLine()!!.split(' ').map { it.toLong() }
        a..b
    }

    val sortByFirst = abList.sortedBy { it.first }
    val sortByLast = abList.sortedBy { it.last }

    val answer = if (n % 2 == 0) {
        val leftMin = sortByFirst.take(n / 2).map { it.first }.max()!!
        val rightMin = sortByFirst.take(n / 2 + 1).map { it.first }.max()!!
        val leftMax = sortByLast.takeLast(n / 2 + 1).map { it.last }.min()!!
        val rightMax = sortByLast.takeLast(n / 2).map { it.last }.min()!!

        ((leftMax + rightMax) - (leftMin + rightMin) + 1).coerceAtLeast(0)
    } else {
        val max = sortByLast[n / 2]
        val min = sortByFirst[n / 2]
        max.last - min.first + 1
    }

    println(answer)
}
