import java.util.*

fun main(args: Array<String>) {
    val argList = Scanner(System.`in`)


    val n = argList.nextLine().toInt()
    val d = argList.nextLine().split(" ").map { it.toInt() }

    val executor = DivideTheProblems()
    val result = executor.execute(n, d)
    println(result)
}

class DivideTheProblems {
    fun execute(n: Int, d: List<Int>): Int {
        val sorted = d.sorted()
        val middle = n / 2

        if (sorted[middle - 1] == sorted[middle]) return 0

        val beforeK = sorted[middle] - 1

        return (sorted[middle - 1]..beforeK).toList().size
    }
}