#include <bits/stdc++.h>
using namespace std;
int main() {
  int nN;
  cin >> nN;
  int nA[100];
  int nSun = 0;
  for (int i = 0; i < nN; i++) {
    cin >> nA[i];
    nSun += nA[i];
  }
  double dbAve = nSun / double(nN);
  int nMinIdx = 0;
  double dbMinAbs = 1000;
  for (int i = 0; i < nN; i++) {
    double dbTmpAbs = abs(nA[i] - dbAve);
    if (dbTmpAbs < dbMinAbs) {
      dbMinAbs = dbTmpAbs;
      nMinIdx = i;
    }
  }
  cout << nMinIdx;
  return 0;
}
