#include <bits/stdc++.h>
using namespace std;
vector<int> vc;
int n;
int num;
double sum;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num;
    sum += num;
    vc.push_back(num);
  }
  double average = sum / n;
  for (int i = 0; i < vc.size(); i++) {
    if (vc[i] < average) {
      cout << i << endl;
      break;
    }
  }
}
