#include<bits/stdc++.h>
using namespace std;
const int N=105;
const double eps=1e-8;
double sum,Min=100;
int n,a[N],pos;
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]),sum+=a[i];
	sum=(double)sum/n;
	for (int i=1;i<=n;i++)
	  if (Min-fabs(a[i]-sum)>eps) Min=fabs(a[i]-sum),pos=i;
	printf("%d\n",pos-1);
	return 0;
}