#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ave = 0;
  int frame = 0;
  int l = 0;
  int min = 0;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  for (int j = 0; j < n; j++) {
    ave += a.at(j);
  }
  ave /= n;
  for (int k = 0; k < n; k++) {
    frame = abs(ave - a.at(k));
    if (k == 0) {
      l = frame;
    } else if (frame < l) {
      l = frame;
      min = k;
    }
  }
  cout << min << endl;
}
