#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int d[111];
int main()
{
	int n;
	scanf("%d", &n);
	int c = 0;
	for (int i = 0; i < n; i++)scanf("%d", &d[i]), c += d[i];
	int maxi = 1000000000, rr = -1;
	for (int i = 0; i < n; i++)if (maxi>abs(c - d[i] * n))maxi = abs(c - d[i] * n), rr = i;
	printf("%d\n", rr);
}