#include <cstdio>
#include <cmath>
#include <cfloat>
#include <climits>
int a[105];
int main() {
	int n;scanf("%d",&n);double sum=0;
	for(register int i=0;i<n;++i) {
		scanf("%d",a+i);sum+=a[i];
	}
	sum/=n;int ans=-1;double now=DBL_MAX;
	for(register int i=0;i<n;++i) {
		if(fabs(a[i]-sum)<now) {
			ans=i;
			now=fabs(a[i]-sum);
		}
	}
	printf("%d\n",ans);
	return 0;
}
