#include <bits/stdc++.h>
int bin_search(int a[], int num, int key);
int main() {
  int N, i;
  int sum = 0;
  int a[1024];
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  printf("%d\n", bin_search(a, N, sum));
  return 0;
}
int bin_search(int a[], int num, int key) {
  int pc;
  int pr = num - 1;
  int tmp = -1;
  int disc;
  int min = abs(a[0] * num - key);
  for (pc = 0; pc <= pr; pc++) {
    disc = abs(a[pc] * num - key);
    if (min > disc) {
      min = disc;
      tmp = pc;
    }
  }
  return tmp;
}
