#include <stdio.h>
#include <algorithm>

int main() {
	int n, a[110], total = 0, diff, min = 1000000000, ans;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
		total += a[i];
	}
	for (int i = 0; i < n; i++) {
		a[i] *= n;
		diff = abs(a[i] - total);
		if (diff < min) {
			ans = i;
			min = diff;
		}
	}
	printf("%d\n", ans);
	return 0;
}