object Main {
	def main(args: Array[String]): Unit = {
		val len = io.StdIn.readInt()
		val levelInt = io.StdIn.readLine().split(" ")
		
		val newList = levelInt.sorted
		
		val upperLimit = newList(len / 2).toInt
		val lowerLimit = newList(len / 2 - 1).toInt
		
		var counter = 0
		
		for (_ <- lowerLimit + 1 to upperLimit) {
			counter += 1
		}
		
		println(counter)
	}
}
