#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
	int n; double sum = 0;
	cin >> n;
	int a[n];
	for(int i = 0; i < n; i++){
		cin >> a[i];
		sum+=a[i];
	}
	sum /= n;
	double dif = 101;int ans;
	for(int i = 0; i < n; i++){
		if(abs(sum-a[i]) < dif){
			ans = i;
			dif = abs(sum-a[i]);
		}
	}
	cout << ans << endl;

    return 0;
}