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