#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  double avg = accumulate(a.begin(), a.end(), 0) / n;
  int ans = -1;
  double p = 101.;
  for (int i = 0; i < n; i++) {
    if (abs(avg - a[i]) < p) {
      ans = i;
      p = abs(a[i] - avg);
    }
  }
  cout << ans << endl;
}
