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

#define F first
#define S second
#define PB push_back
#define all(x) x.begin(), x.end()

typedef long long ll; 
typedef double ld;

const int N = 100 + 10, M = 1000 + 10; 

int a[N];

int32_t main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n, sum = 0;
	for(int i = 0; i < n; i++)
		cin>> a[i], sum += a[i];
	int id = 0;
	for(int i = 1; i < n; i++)
		if(abs(a[i]*n-sun)<abs(a[id]*n-sum))
			id = i;
	cout<< id << endl;
}