#include<bits/stdc++.h>
using namespace std;
int n, sum, ans;
int a[110];
int main()
{
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{	
		scanf("%d", &a[i]);
		sum += a[i];
	}
	for (int i = 1; i < n; i++)
		if (abs(a[i] * n - sum) < abs(a[ans] * n - sum))
			ans = i;
	printf("%d\n", ans);
	return 0;
}