#include <bits/stdc++.h>
#include <algorithm>
#include <string>
using namespace std;
int main() {
	int N; 
	cin >> N; 
	int A[110] = {}; 
	int S = 0; 
	for(int i = 0; i < N; i++){
		cin >> A[i]; 
		S += A[i]; 
	}
	int ans = 0, D = abs(S - N * A[0]); 
	for(int i = 1; i < N; i++){
		if(abs(S - N * A[i]) < D)
		ans = i, D = abs(S - N * A[i]);
	}
	cout << ans << endl; 
}