#include <bits/stdc++.h>
using namespace std;
int i, n;
int main(void) {
  cin >> n;
  double a[n];
  for (i = 0; i < n; ++i) cin >> a[i];
  double total = 0, ave;
  for (i = 0; i < n; ++i) {
    total += a[i];
  }
  ave = total / n;
  double dif[n];
  for (i = 0; i < n; ++i) {
    dif[i] = abs(ave - a[i]);
  }
  int minf = 0, mindif = 100;
  for (i = 0; i < n; ++i) {
    if (dif[i] == 0) {
      minf = i;
      break;
    } else {
      if (dif[i] > mindif) minf = i;
    }
  }
  cout << minf;
  return 0;
}
