#include <bits/stdc++.h>
using namespace std;
int N;
int a[101];
int solve(double ave) {
  int index = 0;
  for (int i = 0; i < N; i++) {
    if (abs(a[i] - ave) < abs(a[index] - ave)) {
      index = i;
    }
  }
  cout << index << endl;
  return 0;
}
int main() {
  cin >> N;
  double ave = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= N + 1;
  solve(ave);
  return 0;
}
