#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b, c = 100000000, r, tmp = 1000;
  cin >> n;
  long double a = 0.0;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
    a += v[i];
  }
  a /= n;
  for (int i = 0; i < 101; ++i) {
    if (i <= a && a < i + 1) {
      if (a - i - 0.5 < 0.00001)
        b = i, c = i + 1;
      else if (a - i > i + 1 - a)
        b = i + 1;
      else
        b = i;
    }
  }
  for (int i = 0; i < n; ++i) {
    int e = min(abs(b - v[i]), abs(c - v[i]));
    if (tmp > e) {
      tmp = e;
      r = i;
    }
  }
  cout << r << endl;
  return 0;
}
