#include <iostream>
#include <cstdio> 
#include <cstring>
#include <cmath>
#include <algorithm>
#define MAXN 100+10
using namespace std;
int main (void)
{
	int n;
	int a[MAXN];
	cin>>n;
	double sum = 0;
	for(int i=0;i<n;i++)
		cin>>a[i],sum+=a[i];
	sum/=(double) n;
	double min = 1e9;
	int t;
	for(int i=0;i<n;i++)
	{
		if(fabs(a[i]-sum)<min)
		{
			min = fabs(a[i]-sum);
			t = i;
		}
	}
	cout<<t<<endl;
	return 0;
}#include <iostream>
#include <cstdio> 
#include <cstring>
#include <cmath>
#include <algorithm>
#define MAXN 100+10
using namespace std;
int main (void)
{
	int n;
	int a[MAXN];
	cin>>n;
	double sum = 0;
	for(int i=0;i<n;i++)
		cin>>a[i],sum+=a[i];
	sum/=(double) n;
	double min = 1e9;
	int t;
	for(int i=0;i<n;i++)
	{
		if(fabs(a[i]-sum)<min)
		{
			min = fabs(a[i]-sum);
			t = i;
		}
	}
	cout<<t<<endl;
	return 0;
}