#include <bits/stdc++.h>
int main(void) {
  int i, n, ans;
  int a[102];
  long int sum = 0;
  double small = 101.0;
  double ave;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d ", &a[i]);
    sum += a[i];
  }
  ave = sum / n;
  for (i = 0; i < n; i++) {
    if (fabs(ave - a[i]) < small) {
      ans = i;
      small = fabs(ave - a[i]);
    }
  }
  printf("%d\n", ans);
  return 0;
}
