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