#include <bits/stdc++.h>
int a[105];
int main() {
  int n;
  scanf("%d", &n);
  int sum = 0;
  for (register int i = 0; i < n; ++i) {
    scanf("%d", a + i);
    sum += a[i];
  }
  sum /= n;
  int ans = -1, now = INT_MAX;
  for (register int i = 0; i < n; ++i) {
    if (abs(a[i] - sum) < now) {
      ans = i;
      now = abs(a[i] - sum);
    }
  }
  printf("%d\n", ans);
  return 0;
}
