#include <bits/stdc++.h>
int main(void) {
  int n, i, b, x, count, answer;
  double s;
  double a[200];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf", &a[i]);
    b = b + a[i];
  }
  b = b * 100;
  s = b;
  x = b / n;
  for (i = 0; i < n; i++) {
    count = (a[i] * 100) - x;
    if (count < 0) {
      count = -1 * count;
    }
    if (count < s) {
      answer = i;
      s = count;
    }
  }
  printf("%d\n", answer);
  return 0;
}
