#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

int n, sum, mi, a[105];
double avg, df, mn=1e9;
int main() {
	int i;
	cin >> n;
	for(i=0; i<n; i++) cin >> a[i], sum += a[i];
	avg = 1.0 * sum / n;
	for(i=0; i<n; i++) {
		df = abs(a[i] - avg);
		if(df < mn) mn = df, mi = i;
	}
	cout << mi;
	return 0;
}