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