#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 105;
int a[maxn];
int main() {
  int n;
  scanf("%d", &n);
  int s = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    s += a[i];
  }
  double ave = s * 1.0 / n;
  double m = INT_MAX;
  int index = -1;
  for (int i = n; i >= 1; --i) {
    if (fabs(ave - a[i]) < m) {
      m = fabs(ave - a[i]);
      ;
      index = i;
    }
  };
  ;
  cout << index - 1 << endl;
  return 0;
}
