#include <bits/stdc++.h>
using namespace std;
int main() {
  double n;
  cin >> n;
  vector<double> a(n);
  double sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sum /= n;
  double min = 10000;
  int number = -1;
  for (int i = 0; i < n; i++) {
    if (abs(sum - a[i]) < min) {
      min = sum - a[i];
      number = i;
    }
  }
  cout << number << endl;
  return 0;
}
