/**
 * @author karayuu
 */

fun main(args: Array<String>) {
    readLine()!!
    val a = readLine()!!.split(" ").map { it.toInt() }

    val ave = Math.round(a.average()).toInt()
    val thumb = a.minBy { Math.abs(it - ave) }!!

    var flame = 0
    for (i in a) {
        if (i == thumb) {
            println(flame)
        } else {
            flame++
        }
    }
}