#include <bits/stdc++.h>
int main() {
  int N, a[105], ans, i;
  double s, plate;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < N; i++) {
    s += a[i];
  }
  s = (double)s / (double)N;
  ans = 0;
  plate = 0;
  for (i = 0; i < N; i++) {
    if (fabs((double)ans - (double)s) > fabs((double)a[i] - (double)s)) {
      if (plate != a[i] - s) {
        ans = i;
        plate = a[i] - s;
      }
    }
  }
  printf("%d\n", ans);
}
