#include <bits/stdc++.h>
int min(int a, int b) {
  if (a >= b) {
    return b;
  }
  return a;
}
int main(void) {
  int n, a[101];
  double sum = 0;
  double min = 999999.9;
  int flag;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum = sum + a[i];
  }
  sum = (double)sum / n;
  for (int i = 0; i < n; i++) {
    if (abs(sum - a[i]) < min) {
      flag = i;
      min = (double)abs(sum - a[i]);
    }
  }
  printf("%d\n", flag);
}
