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