#include <bits/stdc++.h>
#define double long double
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,ans;int a[114];double cnt,inf=1e9;
signed main() {
	cin>>n;
	rep(i,n)cin>>a[i];
	rep(i,n)cnt+=a[i];
	cnt=cnt/n;
	rep(i,n){
		if(abs(a[i]-cnt)<inf){
			inf=abs(a[i]-cnt);
			ans=i;
		}
	}
	cout<<ans<<endl;
}
