#include <bits/stdc++.h>

#define REP(i,n) for (int i=0;i<(n);i++)

using namespace std;

int main(void)
{
    const int N_MAX = 100;
    int N;
    int a[N_MAX];
    cin >> N;
    REP(i, N) cin >> a[i];
    int s = accumulate(a, a + N, 0);
    int b[N_MAX];
    REP(i, N) b[i] = abs(a[i] * N - s);
    cout << (min_element(b, b + N) - b) << endl;
    return 0;
}