
#include<bits/stdc++.h>
using namespace std;

int N;
int a[10000000];
int main() {
	cin >> N;
	int num = 0;
	for (int i = 0; i < N; i++) {
		cin >> a[i];
		num += a[i];
	}
	int ans = 0;
	double n = 100;
	double avarage = (double)num / (double)N;
	for (int i = 0; i < N; i++) {
		if (n > abs(a[i] - avarage)) {
			ans = i;
			n = abs(a[i] - avarage);
		}
	}
	cout << ans << endl;
}