#include <bits/stdc++.h>
using namespace std;
int n, an, t;
double a[110];
double s;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  t = s;
  s /= n;
  for (int i = 0; i < n; i++) {
    if (abs(a[i] - s) < t) {
      t = abs(a[i] - s);
      an = i;
    }
  }
  cout << an;
  return 0;
}
