#include <bits/stdc++.h>
using namespace std;

int a[110];

int main(){
	int n;
	scanf("%d", &n);
	double sum = 0;
	for (int i = 0; i < n; i++){
		scanf("%d", &a[i]);
		sum += a[i];
	}
	sum /= n;
	int pos = -1;
	for (int i = 0; i < n; i++){
		if (pos == -1 || abs(sum - a[pos]) > abs(sum - a[i])) pos = i;
	}
	printf("%d\n", pos);
	return 0;
}
