#include <bits/stdc++.h>
using namespace std;
struct data {
  int place;
  int cost;
  bool operator<(const data &ri) const { return cost < ri.cost; }
  bool operator>(const data &ri) const { return cost > ri.cost; }
};
int nw[9] = {0, 1, 0, -1, -1, 1, 1, -1, 0};
int nh[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
int main() {
  int n;
  int a[100];
  double ave = 0.0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= n;
  int index = -1, dis = 1 << 30;
  for (int i = 0; i < n; i++) {
    if (abs(ave - a[i]) < dis) {
      dis = abs(ave - a[i]);
      index = i;
    }
  }
  cout << index << endl;
  return 0;
}
