#include<bits/stdc++.h>
using namespace std;
const int N = 106;
int a[N];
int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
        cin >> a[i];
    int s = accumulate(a,a+n,0);
    pair<int,int> ans(1e9,1e9);
    for (int i = 0; i < n; ++i) {
        ans = min(ans, {abs(n*a[i]-s),i});
    }
    cout << ans.second << endl;
}
