#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  vector<pair<float, int>> vec(N);
  float avg = 0.0f;
  for (int i = (0); i < (N); i++) {
    int input;
    cin >> input;
    vec[i] = make_pair(input, i);
    avg += (float)vec[i].first;
  }
  avg /= N;
  float minimum = vec[0].first;
  for (int i = (0); i < (N); i++) {
    vec[i].first -= avg;
    if (minimum > vec[i].first) minimum = vec[i].first;
  }
  for (int i = (0); i < (N); i++) {
    if (minimum == vec[i].first) {
      cout << i << endl;
      return 0;
    }
  }
}
