#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c = 0, d = 1000, e = 0;
  cin >> a;
  int test[101] = {0};
  for (int h = 0; h < a; h++) {
    cin >> b;
    c += b;
    test[h] = b;
  }
  for (int j = 0; j < a; j++) {
    if (d > abs(test[j] - c / a)) {
      e = j;
      d = abs(test[j] - c / a);
    }
  }
  cout << e << endl;
  cin >> e;
}
