#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, a[100], smn;
  double ave = 0.0, tmp = 100000.0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= n;
  for (int i = n; i >= 0; i--) {
    if (abs(ave - a[i]) <= tmp) {
      tmp = abs(ave - a[i]);
      smn = i;
    }
  }
  cout << smn << "\n";
  return 0;
}
