#include <cstdio>
#define MAXN (100 + 5)
using namespace std;
int n, a[MAXN], ans, ansi = 101;
int mabs(int x) { return (x > 0) ? x : (-x); }
int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]), a[0] += a[i];
	for (int i = 1; i <= n; i++)
		if (mabs(a[i] * n - a[0]) < mabs(a[ansi] * n - a[0]))
			ansi = i;
	printf("%d", ansi - 1);
	return 0;
}
