#include<cstdio>
#include <cmath>

int a[100];

const int INF = 100000;

int main() {
	int n;
	int sum = 0;
	scanf("%d", &n);
	for(int i=0;i<n;i++) {
		scanf("%d", &a[i]);
		sum += a[i];
	}
	int d = INF;
	int ans = 0;
	for(int i=0;i<n;i++) {
		int e = std::abs(a[i]*n - sum);
		if(e < d) {
			ans = i;
			d = e;
		}
	}
	printf("%d\n", ans);
	return 0;
}
