# include<cstdio>
# include<algorithm>
# include<cmath>
using namespace std;
const int MAX=1e3+4;
int n;
double a[MAX];
int main() {
	double s;
	scanf("%d",&n);
	for(int i=1; i<=n; ++i)
		scanf("%lf",&a[i]),s+=a[i];
	s=s/n;
	double minn=1e18,k=0;
	for(int i=1; i<=n; ++i)
		if(abs(a[i]-s)<minn) k=i-1,minn=abs(a[i]-s);
	printf("%d",int(k));
	}
