#include <bits/stdc++.h>

using namespace std;

#define N 100

int a[N + 1];

int main(){
	int sum, n, i, j;

	scanf("%d", &n);
	sum = 0;

	for (i = 0; i < n; i++){
		scanf("%d", a + i);
		sum += a[i];
	}

	for (j = 0, i = 1; i < n; i++){
		if (abs(n * a[i] - sum) < abs(n * a[j] - sum)){
			j = i;
		}
	}

	printf("%d\n", j);

	return 0;
}