#include <bits/stdc++.h>
using namespace std;
double a[150];
int main() {
  double n, ac, tle;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    ac += a[i];
  }
  int jj = 100000;
  for (int j = 0; j < n; j++) {
    double wa = a[j] - ac / n;
    if (wa < 0) {
      wa = wa * -1;
      if (wa < jj) {
        jj = wa;
        tle = j;
      }
    }
  }
  cout << tle + 1 << endl;
  return 0;
}
