#include <bits/stdc++.h>

using namespace std;
int main()
{
	double n,a[110], sum = 0,ans;
	cin >> n;
	for(int i=0; i<n; i++){
		cin >> a[i];
		sum += a[i];
	}
	double ave = sum / n, tmp = 200;
	for(int i=0; i<n; i++){
		if(abs(ave - a[i]) < tmp ){
			tmp = abs(ave - a[i]);
			ans = i;
		}
	}
	cout << ans << endl;
	
	return 0;
}
