#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &i : a) cin >> i;
  double avg = (accumulate(a.begin(), a.end(), 0)) / n;
  double mini = 100000;
  for (int i = 0; i < n; ++i) {
    mini = min(mini, abs(a[i] - avg));
  }
  for (int i = 0; i < n; ++i) {
    if (abs(a[i] - avg) == mini) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}
