#include <cstdio>
using namespace std;
inline double fabs(double x){return x>0?x:-x;}
int a[110];
int main ()
{
	int n,ans; scanf("%d",&n);
	double sum=0,mi=1e18;
	for(int i=1;i<=n;i++) scanf("%d",&a[i]),sum+=a[i];
	sum/=n;
	for(int i=1;i<=n;i++)
	if(fabs(a[i]-sum)<mi) mi=fabs(a[i]-sum),ans=i;
	printf("%d",ans-1);
	return 0;
}	