#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, count = 0;
  double A[100], B[100], flame, out;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    count += A[i];
  }
  flame = count / N;
  for (int i = 0; i < N; i++) {
    B[i] = flame - A[i];
    if (B[i] < 0) B[i] = -B[i];
  }
  sort(B, B + N);
  for (int i = 0; i < N; i++) {
    if (A[i] == flame + B[0] || A[i] == flame - B[0]) {
      out = i;
      break;
    }
  }
  cout << out << endl;
}
