function main(arg) {
	arg = arg.split("\n")[1].split(" ").map(e => Number(e))
	var sum = 0
	for (var i = 0; i < arg.length; i++) {
		sum += arg[i]
	}
	var avg = sum / arg.length

	var n_min
	var n = 0

	for (var i = 0; i < arg.length; i++) {
		if (i ===0 ) {
			n = i
			n_min = Math.abs(arg[i] - avg)
			continue;
		}

		if (Math.abs(arg[i] - avg) < n_min) {
			n = i
			n_min = Math.abs(arg[i] - avg)
		}
	}

	console.log(n)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));