#include<iostream>
using namespace std;
typedef long long int LL;

int main(){
	int n;
	int i,j,k;
	int a[105];
	double d,e,f;
	int s=0;
	cin>>n;
	for(i=0;i<n;i++){
		cin>>a[i];
		d+=a[i];
	}
	d/=(double)n;
	f=d;
	for(i=0;i<n;i++){
		e=(double)a[i]-d;
		if(e<0)e=-e;
		if(e<f)s=i,f=e;
	}
	cout<<s<<endl;
	return 0;
	
}
