#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, arry[105], ans = 0;
  unsigned long long sum = 0;
  double aver = 0, minxn = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arry[i];
    sum += arry[i];
  }
  aver = sum / n;
  for (int i = 0; i < n; i++) {
    if (minxn < aver && minxn < arry[i]) {
      minxn = arry[i];
    }
    if (aver > arry[i]) {
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
