#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  int i, sum = 0;
  int num;
  float min = 32000;
  for (i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  float avg = (float)sum / n;
  sort(a, a + n);
  for (i = 0; i < n; ++i) {
    if (min > abs(avg - (float)a[i])) {
      min = abs(avg - (float)a[i]);
      num = i;
    }
  }
  printf("%d", num);
}
