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