#include <bits/stdc++.h>
using namespace std;
const long long int MOD = pow(10, 9) + 7;
int main() {
  int N;
  cin >> N;
  vector<double> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  double ave = 0;
  for (int i = 0; i < N; i++) {
    ave += A[i];
  }
  double m = 0;
  ave /= N;
  for (int i = 0; i < N; i++) {
    m = min(m, ave - A[i]);
  }
  for (int i = 0; i < N; i++) {
    if (ave - A[i] == m) {
      cout << i - 1 << endl;
      return 0;
    }
  }
}
