#include <bits/stdc++.h>
double average(int flame, int inflame[]) {
  int i;
  int sum = 0;
  for (i = 0; i < flame; i++) {
    sum += inflame[i];
  }
  return (double)sum / (double)flame;
}
double length_ave(int a, double ave) { return fabs(a - ave); }
int main() {
  int flame;
  double ave;
  int samune;
  int min_length;
  int* fla_val;
  int i;
  scanf("%d", &flame);
  fla_val = (int*)calloc(flame, sizeof(int));
  for (i = 0; i < flame; i++) scanf("%d", fla_val + i);
  ave = average(flame, fla_val);
  for (i = 0; i < flame; i++) {
    if (i == 0 || min_length > length_ave(fla_val[i], ave)) {
      samune = i;
      min_length = length_ave(fla_val[i], ave);
      continue;
    }
  }
  printf("%d\n", samune);
  free(fla_val);
  return 0;
}
