#include<iostream> 
#include<string> 
#include<vector>  
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++)
	{
		cin >> a.at(i);
	}
	int he = 0;
	double hei = 0;
	for (int i = 0; i < n; i++)
	{
		he += a.at(i);
	}
	hei = he / n;
	double x = 101;
	int ans = 0;
	for (int i = 0; i <n; i++)
	{
		if (fabs(a.at(i) - hei)<x)
		{
			x = fabs(a.at(i) - hei);
			ans = i;
		}

	}
	cout << ans << "\n";
}