#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a.at(i);
  double sum = 0;
  for (int i = 0; i < (n); ++i) sum += a.at(i);
  sum /= n;
  int ans = 0, d = 10000;
  for (int i = 0; i < (n); ++i) {
    if (d > abs(sum - a.at(i))) {
      ans = i;
      d = abs(sum - a.at(i));
    }
  }
  cout << ans << endl;
}
