#include<bits/stdc++.h>
using namespace std;

int main(){
vector<double> v;
	int n,z;
double n2,a,sum=0,x,box=100000;
	cin >> n;
n2=n;
for(int i=0;i<n;i++){
 cin>>a;
v.push_back(a);
sum+=a;
}
sum/=n2;

for(int i=0;i<n;i++){
if(v[i]<=sum) x=sum-v[i];
else x=v[i]-sum;

if(box>x){
box=x;
z=i;
}
}

	cout << z  << endl;
	return 0;
}