#include <bits/stdc++.h>
using namespace std;
static const int MAX = 100;
int main(void) {
  int N;
  cin >> N;
  int A[MAX];
  double res = 0;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    res += A[i];
  }
  res /= N;
  int ans, xmin = 10e9;
  for (int i = 0; i < N; i++) {
    if (abs(A[i] - res) < xmin) {
      xmin = abs(A[i] - res);
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
