#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double sum = 0;
  double a[105];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum = sum + a[i];
  }
  double x = (sum * 1.0) / (n * 1.0);
  int f = 1;
  double min = 100000000;
  double g = fabs(a[1] - x);
  for (int i = 1; i < n; i++) {
    double t = fabs(a[i] - x);
    if (t == g) {
      f = 0;
    } else {
      f = 1;
    }
  }
  int p;
  for (int i = 0; i < n; i++) {
    double t = fabs(a[i] - x);
    if (t < min) {
      min = t;
      p = i + 1;
    }
  }
  if (f == 0)
    cout << "0";
  else
    cout << p;
}
