#include<stdio.h>
#include<string.h> 
#include<stdlib.h>
#include<math.h>

int main(void){
	int n;
	int a[100];	
	int i;
	int ret;

	double min,ave;

	scanf("%d",&n);

	ave = 0;

	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		ave += a[i];
	}

	ave /= n;
	min = 100;
	ret = 0;
	for(i=0;i<n;i++){
		if(min>abs(a[i]-ave)){
			min = abs(a[i]*100-int(ave*100.0)/100.0;
			ret = i;
		}
	}

	if(n==1){
		printf("0\n");
	}
	else{
		printf("%d\n",ret);
	}

	return 0;
}
