#include <bits/stdc++.h>
int main() {
  int n, r;
  double a[100], min = 1e9, ave = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    ave += a[i];
  }
  ave /= n;
  for (int i = 0; i < n; i++) {
    if (abs(ave - a[i]) < min) {
      r = i;
      min = abs(ave - a[i]);
    }
  }
  printf("%d", r);
  return 0;
}
