#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[110], sum;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  double m = (double)sum / (double)n;
  int ans = 0;
  double dif = 1000;
  for (int i = 0; i < n; i++) {
    double k = m - (double)a[i];
    if (k > 0) k *= -1;
    if (dif > k) {
      dif = k;
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
