#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
	int n; cin >> n;
	double a[101], sum = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i]; sum += a[i];
	}
	sum /= n;
	double d = abs(sum - a[0]); int ans = 0;
	for (int i = 1; i < n; i++) {
		if (d > abs(sum - a[i])) {
			d = abs(sum - a[i]);
			ans = i;
		}
	}
	cout << ans << endl;
}