#include <cstdio>

int a[110];
#define cabs(_x) ((_x) < 0 ? (-(_x)) : (_x))
int main()
{
	int n, sum = 0; scanf("%d", &n);
	for (int i = 0; i < n; ++i) scanf("%d", a + i), sum += a[i];
	int minn = 0x7fffffff, minpos = 0;
	for (int i = 0; i < n; ++i)
		minn > cabs(sum - n * a[i]) ? minn = cabs(sum - n * a[i]), minpos = i : 0;
	printf("%d\n", minpos);
	return 0;
}