#include <bits/stdc++.h>

using namespace std;

const int MXN = 110;

int a[MXN];

int main ()
{
	int n, sum = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &a[i]);
		sum += a[i];
	}
	int best = 1e4 + 10, ans;
	for (int i = 0; i < n; i++)
	{
		if (abs(sum - n * a[i]) < best)
		{
			best = abs(sum - n * a[i]);
			ans = i; 
		}
	}
	printf("%d", ans);
	return 0;
}
