#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, i, minnum = 1000, mina;
  double ave = 0;
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= n;
  for (i = 0; i < n; i++) {
    if (minnum > abs(ave - a[i])) {
      mina = i;
      minnum = abs(ave - a[i]);
    }
  }
  cout << mina << endl;
  return 0;
}
