#include<bits/stdc++.h>

using namespace std;
double a[111];
int main()
{
	int n;
	double sum = 0,mins=999999999;
	int wz=-1;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		
		scanf("%lf", &a[i]);
		sum += a[i];
	}
	sum /= n;
	for (int i = 0; i < n; i++)
	{
		if (fabs(sum - a[i]) < mins)
		{
			mins = fabs(sum - a[i]);
			wz = i;
		}
	}
	printf("%d", wz);
}