#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  double s = 0;
  for (auto& x : a) {
    cin >> x;
    s += x;
  }
  s /= n;
  int idx = 0, mi = 110;
  for (int i = 0; i < n; i++) {
    int t = abs(a[i] - s);
    if (t < mi) {
      idx = i;
      mi = t;
    }
  }
  cout << idx << endl;
  return 0;
}
