#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    sum += v[i];
  }
  double x = (double)sum / n;
  int ans = 10000, res;
  for (int i = 0; i < n; i++) {
    if (ans > abs(x - v[i])) {
      ans = abs(x - v[i]);
      res = i;
    }
  }
  cout << res << endl;
}
