#include<bits/stdc++.h>
using namespace std;
int a[105];
int main(){
	int N; 
	double ave = 0;
	scanf("%d",&N);
	for(int i = 0 ; i < N ; ++i){
		scanf("%d",&a[i]);
		ave += a[i];
	}
	
	ave /= N;
	int ind;
	double dis = 10000;
	for(int i = 0 ; i < N ; ++i){
		if(abs(a[i] - ave) < dis){
			dis = abs(a[i] - ave);
			ind = i;
		}	
	}
	
	printf("%d\n",ind);
	return 0;	
}