#include <bits/stdc++.h>
using namespace std;
void no() {
  cout << "No" << endl;
  exit(0);
}
void yes() {
  cout << "Yes" << endl;
  exit(0);
}
void No() {
  cout << "NO" << endl;
  exit(0);
}
void Yes() {
  cout << "YES" << endl;
  exit(0);
}
int main() {
  int n;
  cin >> n;
  vector<int> a(110);
  for (int i = 0; i < n; i++) cin >> a[i];
  int sum = 0, ave;
  for (int i = 0; i < n; i++) sum += a[i];
  ave = sum / n;
  int ans = 101, tmp = 101, use;
  for (int i = 0; i < n; i++) {
    use = abs(ave - a[i]);
    if (use < tmp) {
      if (i < ans) {
        ans = i;
        tmp = use;
      } else
        continue;
    }
  }
  cout << ans << endl;
  return 0;
}
