fun main(args: Array<String>) = yorukatsu6A()

fun yorukatsu6A() {
    val n = readLine()!!.toInt()
    val dList = readLine()!!.split(' ').map { it.toInt() }

    val cSum = IntArray(100001)
    for (i in 0 until n) cSum[dList[i]]++
    for (i in 0 until cSum.lastIndex) cSum[i + 1] += cSum[i]

    val answer = cSum.count { it == n / 2 }

    println(answer)
}
