#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  int a[N];
  int sum = 0;
  for (int i = 0; i < N; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  int ave = sum / N;
  for (int j = 0; j < 100; j++) {
    for (int i = 0; i < N; i++) {
      if (a[i] == ave + j || a[i] == ave - j) {
        printf("%d", i);
        return 0;
      }
    }
  }
  return 0;
}
