#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  double m = 0.0;
  cin >> n;
  vector<long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m += a[i];
  }
  m /= n;
  sort(a.begin(), a.end());
  double t = 10000.0;
  for (int i = 0; i < n; i++) {
    if (t > abs(m - (double)(a[i]))) {
      t = abs(m - (double)(a[i]));
      k = i;
    }
  }
  cout << k << endl;
}
