#include <bits/stdc++.h>
using namespace std ;
#define ll long long 
#define f(i, x, n) for (int i = x; i < (int)(n); ++i)

int const N = 100;
int x[N];

int main(){
	int n;
	scanf("%d", &n);
	f(i, 0, n)scanf("%d", x + i);
	int s = 0;
	f(i, 0, n)x[i] *= n, s += x[i];
	s /= n;
	int an = 0;
	f(i, 1, n)if (abs(x[i] - s) < abs(x[an] - s))an = i;
	printf("%d\n", an);
}