#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll Max(ll(a), ll(b), ll(c)) { return max(max(a, b), c); }
ll Min(ll(a), ll(b), ll(c)) { return min(min(a, b), c); }
ll gcd(ll(a), ll(b)) {
  ll c = a;
  while (a % b != 0) {
    c = a % b;
    a = b;
    b = c;
  }
  return b;
}
int main() {
  double N, s = 0, X, an = 0, m = 999999;
  cin >> N;
  vector<double> p(N);
  for (long long i = 0; i < (long long)(N); i++) {
    cin >> p.at(i);
    s += p.at(i);
  };
  s /= N;
  for (long long i = 0; i < (long long)(N); i++) {
    if (m > abs(s - p.at(i))) {
      m = m > abs(s - p.at(i));
      an = i;
    }
  }
  cout << an << endl;
}
