#include <bits/stdc++.h>
int main(void) {
  int N;
  int a[100];
  double avg;
  int sm;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < N; i++) {
    avg += a[i];
  }
  avg /= N;
  double b[N];
  int min;
  for (int i = 0; i < N; i++) {
    b[i] = fabs((double)a[i] - avg);
  }
  for (int i = 0; i < N; i++) {
    min = b[0];
    if (b[0] > b[i]) min = b[i];
  }
  int c = 0;
  for (int i = 0; i < N; i++) {
    if (a[i] == min) {
      c++;
      sm = i;
    }
    if (c == 1) break;
  }
  printf("%d", sm);
}
