#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);
}
using namespace std;
int main() {
  int n, a[110];
  cin >> n;
  for (int i = 0; i <= n - 1; i++) {
    cin >> a[i];
  }
  int sum = 0, ave;
  for (int i = 0; i <= n - 1; i++) {
    sum += a[i];
  }
  ave = sum / n;
  int ans = 100, tmp = 100;
  for (int i = 0; i <= n - 1; i++) {
    int sa = abs(a[i] - ave);
    if (sa <= ans && i <= tmp) {
      ans = sa;
      tmp = i;
    }
  }
  cout << tmp << endl;
  return 0;
}
