#include <bits/stdc++.h>
int main() {
  int a[101], sum = 0, n, k, m, i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  double avg = sum / n;
  double min = 1000;
  for (i = 0; i < n; i++) {
    if (fabs(avg - (double)a[i]) < min) {
      min = fabs(avg - (double)a[i]);
      k = i;
    }
  }
  printf("%d", k);
  return 0;
}
