#include <bits/stdc++.h>
int main() {
  int i, j;
  double N, sum, ave, x, y;
  double a[1000];
  sum = ave = 0.0;
  x = 100.0;
  scanf("%lf", &N);
  for (i = 0; i < N; ++i) {
    scanf("lf", &a[i]);
    sum += a[i];
  }
  ave = sum / N;
  for (i = 0; i < N; ++i) {
    if (ave - a[i] > 0) {
      y = ave - a[i];
    } else {
      y = a[i] - ave;
    }
    if (y < x) {
      x = y;
      j = i;
    }
  }
  printf("%d\n", j);
  return 0;
}
