#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int ai;
    cin >> ai;
    a.push_back(ai);
  }
  float avg = accumulate(a.begin(), a.end(), 0) / a.size();
  float minDiff = 100.0;
  int index = 0;
  for (int i = 0; i < n; i++) {
    if (minDiff > abs(float(a[i]) - avg)) {
      minDiff = abs(float(a[i]) - avg);
      index = i;
    }
  }
  cout << index << endl;
  return 0;
}
