#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  vector<double> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  double ave = accumulate(a.begin(), a.end(), double(0)) / n;
  for (int i = 0; i < n; ++i) a[i] = abs(a[i] - ave);
  cout << min_element(a.begin(), a.end()) - a.begin();
}
