#include<cstdio>
#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main(){
	int n;
	cin>>n;
	double sum=0;
	double a[105];
	for(int i=0;i<n;i++){
		cin>>a[i];
		sum+=a[i];
	}
	for(int i=0;i<n;i++){
		a[i]-=sum/n;
	}
	double minn=999;
	int k=0;
	for(int i=0;i<n;i++){
		if(abs(a[i])<minn){
			k=i;
			minn=abs(a[i]);
		}
	}
	printf("%d",k);
	return 0;
}