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

int N;
double A[110];
int main(){
	cin >> N;
	double sum = 0;
	for(int i=0;i<N;i++){
		cin >> A[i];
		sum += A[i];
	}
	sum /= N;
	int ans = -1;
	double l = 1e9;
	for(int i=0;i<N;i++){
		if(abs(sum-A[i])<l){
			ans = i;
			l = abs(sum-A[i]);
		}
	}
	cout << ans << endl;
}