#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, ans;
  double ave;
  cin >> N;
  vector<int> vec(N);
  vector<double> dif(N);
  for (int i = 0; i < N; i++) cin >> vec.at(i);
  for (int x : vec) ave += x;
  ave = ave / N;
  for (int i = 0; i < N; i++) dif.at(i) = abs(vec.at(i) - ave);
  for (int i = 0; i < N - 1; i++) {
    if (dif.at(i) > dif.at(i + 1)) ans = i + 1;
    if (dif.at(0) == 0 || dif.at(i + 1) == 0) break;
  }
  cout << ans << endl;
}
