#include <bits/stdc++.h>
int main(void) {
  int n = 0, ans = 0;
  double sum = 0, a[110], heikin = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  heikin = (double)sum / (double)n;
  ans = n - 1;
  for (int i = n - 2; 0 <= i; i--) {
    if (abs(a[ans] - heikin) >= abs(a[i] - heikin)) {
      ans = i;
    }
  }
  printf("%d", ans);
  return 0;
}
