#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, tmp;
  vector<int> a;
  float sum;
  int as = 101;
  int fl = 0;
  int ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    a.push_back(tmp);
  }
  for (int j = 0; j < a.size(); j++) sum += a[j];
  sum /= n;
  for (int k = 0; k < n; k++) {
    fl = abs(sum - a[k]);
    if (fl < as) {
      as = fl;
      ans = k;
    }
  }
  cout << ans << endl;
  return 0;
}
