#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  double mean = 0.0;
  vector <int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
    mean += vec.at(i);
  }
  mean /= n;
  int dif = 100;
  int ans;
  for (int i = 0; i < n; i++) {
    if (vec.at(i) >= mean) {
      if (dif > (vec.at(i)-mean)) {
        dif = vec.at(i) - mean;
        ans = i;
      }
    } else {
      if (dif > (mean-vec.at(i)) {
        dif = mean - vec.at(i);
        ans = i;
      }
    }
  }
          
  cout << ans << endl;
}