#include<cstdio>
#include<functional>
#include<algorithm>
using namespace std;
int main(void)
{
	int n,a[100],sum,b[100],mn,mi,x,i;
	scanf("%d",&n);
	sum=0;
	for(i=0;i<n;i++)	{
		scanf("%d",&a[i]);
		sum+=a[i];
		b[i]=a[i]*n;
	}
	mn=sum;
	for(i=0;i<n;i++)	{
		x=sum-b[i];
		if(x<0)	x=-x;
		if(mn>x)	{
			mn=x;
			mi=i;
		}
	}
	printf("%d\n",mi);
	return 0;
}