int main()
{
	int N=0;
	int a[100];
	double ave;
	double sa=100000;
	int minnumber;
	scanf("%d",&N);
	for (int i=0;i<N;i++)
	{
		scanf("%d",&a[i]);
	}
	for (int i=0;i<N;i++)
	{
		ave+=a[i];
	}
	ave/=(N+1.0);
	for (int i=0;i<N;i++)
	{
		if(sa<a[i]-ave)
		{
			sa=a[i]-ave;
			minnumber=i;
		}
	}
	printf("%d",minnumber);
}