#include<bits/stdc++.h>
#define inf ((float)(1e9))
using namespace std;
const int maxn=100;
int n,a[maxn],sum=0,pos=-1;
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		sum+=a[i];
	}
	float s=(float)sum/n,minn=inf;
	for(int i=0;i<n;i++)
		if(abs(a[i]-s)<minn)
		{
			minn=abs(a[i]-s);
			pos=i;
		}
	cout<<pos<<endl;
	return 0;
}