#include <bits/stdc++.h>
int main() {
  int n, a[100], ave = 0, min = 1e9, r;
  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(a[i] - ave) < min) {
      r = i;
      abs(a[i] - ave);
    }
  printf("%d", r);
  return 0;
}
