#include <iostream>
#include <cstdio>

int a[110];

int Abs(int x) {return x > 0 ? x : -x;}
int main()
{
	int n; scanf("%d", &n); int s = 0;
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]), s += a[i];
	int id = -1, ans = 1e9;
	for(int i = 1; i <= n; i++)
	{
		if(Abs(a[i] * n - s) < ans) ans = Abs(a[i] * n - s), id = i;
	}
	printf("%d\n", id - 1);
}