#include <bits/stdc++.h>
int cmpint(const void *x, const void *y) { return *(int *)x - *(int *)y; }
int main() {
  int n, a[100], sum = 0, min;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  qsort(a, n, sizeof(int), cmpint);
  double ave = (double)sum / n;
  double dif = 1e9;
  for (int i = 0; i < n; i++) {
    if (dif > fabs(ave - a[i])) {
      dif = fabs(ave - a[i]);
      min = i;
    }
  }
  printf("%d\n", min);
  return 0;
}
